diff options
-rw-r--r-- | src/plugins/git/gitclient.cpp | 27 | ||||
-rw-r--r-- | src/plugins/git/gitclient.h | 6 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.cpp | 12 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.h | 14 |
4 files changed, 21 insertions, 38 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 793a551a66b..0a10ff7ae06 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1611,7 +1611,7 @@ bool GitClient::executeSynchronousStash(const QString &workingDirectory, const unsigned flags = VcsBasePlugin::ShowStdOutInLogWindow | VcsBasePlugin::ExpectRepoChanges | VcsBasePlugin::ShowSuccessMessage; - const SynchronousProcessResponse response = synchronousGit(workingDirectory, arguments, flags); + const SynchronousProcessResponse response = vcsSynchronousExec(workingDirectory, arguments, flags); const bool rc = response.result == SynchronousProcessResponse::Finished; if (!rc) msgCannotRun(arguments, workingDirectory, response.stdErr.toLocal8Bit(), errorMessage); @@ -1948,17 +1948,6 @@ bool GitClient::isValidRevision(const QString &revision) const return false; } -// Synchronous git execution using Utils::SynchronousProcess, with -// log windows updating. -SynchronousProcessResponse GitClient::synchronousGit(const QString &workingDirectory, - const QStringList &gitArguments, - unsigned flags, - QTextCodec *outputCodec) const -{ - return VcsBasePlugin::runVcs(workingDirectory, vcsBinary(), gitArguments, vcsTimeoutS(), - flags, outputCodec, processEnvironment()); -} - void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool prompt) { if (!m_updatedSubmodules.isEmpty() || submoduleList(workingDirectory).isEmpty()) @@ -2211,7 +2200,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR const unsigned flags = VcsBasePlugin::SshPasswordPrompt | VcsBasePlugin::SuppressStdErrInLogWindow | VcsBasePlugin::SuppressFailMessageInLogWindow; - const SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags); + const SynchronousProcessResponse resp = vcsSynchronousExec(workingDirectory, arguments, flags); QStringList branches; branches << tr("<Detached HEAD>"); QString headSha; @@ -2779,7 +2768,7 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory, | VcsBasePlugin::ShowStdOutInLogWindow | VcsBasePlugin::ExpectRepoChanges | VcsBasePlugin::ShowSuccessMessage; - const SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags); + const SynchronousProcessResponse resp = vcsSynchronousExec(workingDirectory, arguments, flags); ConflictHandler conflictHandler(0, workingDirectory, abortCommand); // Notify about changed files or abort the rebase. const bool ok = resp.result == SynchronousProcessResponse::Finished; @@ -2904,7 +2893,7 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory) const unsigned flags = VcsBasePlugin::SshPasswordPrompt | VcsBasePlugin::ShowStdOutInLogWindow | VcsBasePlugin::ShowSuccessMessage; - synchronousGit(workingDirectory, args, flags); + vcsSynchronousExec(workingDirectory, args, flags); } void GitClient::subversionLog(const QString &workingDirectory) @@ -3152,8 +3141,8 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url) arguments.clear(); arguments << QLatin1String("fetch"); - const SynchronousProcessResponse resp = - synchronousGit(workingDirectory.path(), arguments, flags); + const SynchronousProcessResponse resp + = vcsSynchronousExec(workingDirectory.path(), arguments, flags); if (resp.result != SynchronousProcessResponse::Finished) return false; @@ -3176,8 +3165,8 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url) QStringList arguments(QLatin1String("clone")); arguments << QLatin1String(url) << workingDirectory.dirName(); workingDirectory.cdUp(); - const SynchronousProcessResponse resp = - synchronousGit(workingDirectory.path(), arguments, flags); + const SynchronousProcessResponse resp + = vcsSynchronousExec(workingDirectory.path(), arguments, flags); resetCachedVcsInfo(workingDirectory.absolutePath()); return (resp.result == SynchronousProcessResponse::Finished); } diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 85ec20e6d72..5f5e0bb8e56 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -373,12 +373,6 @@ private: bool useOutputToWindow = false, unsigned additionalFlags = 0, int editorLineNumber = -1); - // Synchronous git execution using Utils::SynchronousProcess, with - // log windows updating (using VcsBasePlugin::runVcs with flags). - inline Utils::SynchronousProcessResponse - synchronousGit(const QString &workingDirectory, const QStringList &arguments, - unsigned flags = 0, QTextCodec *outputCodec = 0) const; - // determine version as '(major << 16) + (minor << 8) + patch' or 0. unsigned synchronousGitVersion(QString *errorMessage = 0) const; diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index a717fa5f081..6454486980c 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -400,13 +400,13 @@ bool VcsBaseClient::synchronousPush(const QString &workingDir, return resp.result == Utils::SynchronousProcessResponse::Finished; } -Utils::SynchronousProcessResponse VcsBaseClient::vcsSynchronousExec(const QString &workingDirectory, - const QStringList &args, - unsigned flags, - QTextCodec *outputCodec) const +Utils::SynchronousProcessResponse VcsBaseClientImpl::vcsSynchronousExec(const QString &workingDir, + const QStringList &args, + unsigned flags, + QTextCodec *outputCodec) const { - return VcsBasePlugin::runVcs(workingDirectory, vcsBinary(), args, vcsTimeoutS(), flags, - outputCodec); + return VcsBasePlugin::runVcs(workingDir, vcsBinary(), args, vcsTimeoutS(), flags, + outputCodec, processEnvironment()); } void VcsBaseClient::annotate(const QString &workingDir, const QString &file, diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 559b0c929a6..eaf8f28da27 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -115,6 +115,13 @@ protected: QByteArray *outputData, QByteArray *errorData = 0, unsigned flags = 0) const; + // Synchronous VCS execution using Utils::SynchronousProcess, with + // log windows updating (using VcsBasePlugin::runVcs with flags) + Utils::SynchronousProcessResponse vcsSynchronousExec(const QString &workingDir, + const QStringList &args, + unsigned flags = 0, + QTextCodec *outputCodec = 0) const; + private: void saveSettings(); void commandFinishedGotoLine(QWidget*); @@ -226,13 +233,6 @@ protected: QString vcsEditorTitle(const QString &vcsCmd, const QString &sourceId) const; - // Synchronous VCS execution using Utils::SynchronousProcess, with - // log windows updating (using VcsBasePlugin::runVcs with flags) - Utils::SynchronousProcessResponse vcsSynchronousExec(const QString &workingDir, - const QStringList &args, - unsigned flags = 0, - QTextCodec *outputCodec = 0) const; - private: void statusParser(const QString&); |