Commit 4b624ba7 authored by Tobias Hunger's avatar Tobias Hunger

Vcs: Optionally pass binary to run

Change-Id: I33eb1ce7d874bea27979068aca310f607ec7fde8
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent e9b4cab8
......@@ -175,6 +175,18 @@ QString VcsBaseClientImpl::stripLastNewline(const QString &in)
return in;
}
Utils::SynchronousProcessResponse
VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const Utils::FileName &binary,
const QStringList &args, unsigned flags,
int timeoutS, QTextCodec *codec) const
{
VcsCommand command(workingDir, processEnvironment());
command.addFlags(flags);
if (codec)
command.setCodec(codec);
return command.runCommand(binary, args, (timeoutS > 0) ? timeoutS : vcsTimeoutS());
}
void VcsBaseClientImpl::resetCachedVcsInfo(const QString &workingDir)
{
Core::VcsManager::resetVersionControlForDirectory(workingDir);
......@@ -197,11 +209,7 @@ Utils::SynchronousProcessResponse
VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const QStringList &args,
unsigned flags, int timeoutS, QTextCodec *codec) const
{
VcsCommand command(workingDir, processEnvironment());
command.addFlags(flags);
if (codec)
command.setCodec(codec);
return command.runCommand(vcsBinary(), args, (timeoutS > 0) ? timeoutS : vcsTimeoutS());
return vcsFullySynchronousExec(workingDir, vcsBinary(), args, flags, timeoutS, codec);
}
VcsCommand *VcsBaseClientImpl::vcsExec(const QString &workingDirectory, const QStringList &arguments,
......
......@@ -103,6 +103,10 @@ public:
Utils::SynchronousProcessResponse
vcsFullySynchronousExec(const QString &workingDir, const QStringList &args,
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
Utils::SynchronousProcessResponse
vcsFullySynchronousExec(const QString &workingDir, const Utils::FileName &binary, const QStringList &args,
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
// Simple helper to execute a single command using createCommand and enqueueJob.
VcsCommand *vcsExec(const QString &workingDirectory, const QStringList &arguments,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment