Commit 60f5372b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Vcs: Get rid of second implementation to run commands fully synchronously



Change-Id: I996e4292a751f6570e3e645bfcabf00f8a168a59
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 7719fb66
......@@ -375,36 +375,12 @@ bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir,
const QStringList &args,
QByteArray *output) const
{
QProcess vcsProcess;
if (!workingDir.isEmpty())
vcsProcess.setWorkingDirectory(workingDir);
vcsProcess.setProcessEnvironment(processEnvironment());
VcsOutputWindow::appendCommand(workingDir, vcsBinary(), args);
const Utils::FileName binary = vcsBinary();
vcsProcess.start(binary.toString(), args);
if (!vcsProcess.waitForStarted()) {
VcsOutputWindow::appendError(tr("Unable to start process \"%1\": %2")
.arg(binary.toUserOutput(), vcsProcess.errorString()));
return false;
}
vcsProcess.closeWriteChannel();
QByteArray stdErr;
if (!Utils::SynchronousProcess::readDataFromProcess(vcsProcess, vcsTimeoutS() * 1000,
output, &stdErr, true)) {
Utils::SynchronousProcess::stopProcess(vcsProcess);
VcsOutputWindow::appendError(tr("Timed out after %1s waiting for the process %2 to finish.")
.arg(vcsTimeoutS()).arg(binary.toUserOutput()));
return false;
}
if (!stdErr.isEmpty())
VcsOutputWindow::appendError(QString::fromLocal8Bit(stdErr));
return vcsProcess.exitStatus() == QProcess::NormalExit && vcsProcess.exitCode() == 0;
QByteArray errorData;
QScopedPointer<VcsCommand> command = createCommand(workingDir);
bool result = command->runFullySynchronous(args, vcsTimeoutS(), output, &errorData);
if (!errorData.isEmpty())
VcsOutputWindow::appendError(QString::fromLocal8Bit(errorData));
return result;
}
Utils::SynchronousProcessResponse VcsBaseClient::vcsSynchronousExec(const QString &workingDirectory,
......
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