VCS[svn]: Extract runSVN overload with username/password.

to aid trac plugin implementation.
This commit is contained in:
Friedemann Kleint
2010-06-08 10:04:23 +02:00
parent d7747fe849
commit 310194cb9f
5 changed files with 58 additions and 33 deletions

View File

@@ -37,8 +37,6 @@ static const char userKeyC[] = "User";
static const char passwordKeyC[] = "Password";
static const char authenticationKeyC[] = "Authentication";
static const char userNameOptionC[] = "--username";
static const char passwordOptionC[] = "--password";
static const char promptToSubmitKeyC[] = "PromptForSubmit";
static const char timeOutKeyC[] = "TimeOut";
static const char spaceIgnorantAnnotationKeyC[] = "SpaceIgnorantAnnotation";
@@ -107,23 +105,3 @@ bool SubversionSettings::equals(const SubversionSettings &s) const
&& promptToSubmit == s.promptToSubmit
&& spaceIgnorantAnnotation == s.spaceIgnorantAnnotation;
}
QStringList SubversionSettings::addOptions(const QStringList &args) const
{
if (!useAuthentication || user.isEmpty())
return args;
// SVN pre 1.5 does not accept "--userName" for "add", which is most likely
// an oversight. As no password is needed for the option, generally omit it.
if (!args.empty() && args.front() == QLatin1String("add"))
return args;
QStringList rc;
rc.push_back(QLatin1String(userNameOptionC));
rc.push_back(user);
if (!password.isEmpty()) {
rc.push_back(QLatin1String(passwordOptionC));
rc.push_back(password);
}
rc.append(args);
return rc;
}