forked from qt-creator/qt-creator
Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra SynchronousProcessResponse structure only causes copies of the data and complicates access on the user side in a lot of cases. The result bits are now also accessible individually. There's obvious room for follow-up changes on the topic, e.g. ShellCommand::runCommand's parameter list could shrink to just a SynchronousProcess parameter. Change-Id: I45aa7eb23832340be06905929280c012e1217263 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -91,10 +91,10 @@ bool SubversionClient::doCommit(const QString &repositoryRoot,
|
||||
<< QLatin1String("--file") << commitMessageFile;
|
||||
|
||||
QStringList args(vcsCommandString(CommitCommand));
|
||||
SynchronousProcessResponse resp =
|
||||
vcsSynchronousExec(repositoryRoot, args << svnExtraOptions << escapeFiles(files),
|
||||
VcsCommand::ShowStdOut | VcsCommand::NoFullySync);
|
||||
return resp.result == SynchronousProcessResponse::Finished;
|
||||
SynchronousProcess proc;
|
||||
vcsSynchronousExec(proc, repositoryRoot, args << svnExtraOptions << escapeFiles(files),
|
||||
VcsCommand::ShowStdOut | VcsCommand::NoFullySync);
|
||||
return proc.result() == QtcProcess::Finished;
|
||||
}
|
||||
|
||||
void SubversionClient::commit(const QString &repositoryRoot,
|
||||
@@ -151,12 +151,12 @@ QString SubversionClient::synchronousTopic(const QString &repository) const
|
||||
else
|
||||
svnVersionBinary = svnVersionBinary.left(pos + 1);
|
||||
svnVersionBinary.append(HostOsInfo::withExecutableSuffix("svnversion"));
|
||||
const SynchronousProcessResponse result
|
||||
= vcsFullySynchronousExec(repository, {svnVersionBinary, args});
|
||||
if (result.result != SynchronousProcessResponse::Finished)
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, repository, {svnVersionBinary, args});
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return QString();
|
||||
|
||||
return result.stdOut().trimmed();
|
||||
return proc.stdOut().trimmed();
|
||||
}
|
||||
|
||||
QString SubversionClient::escapeFile(const QString &file)
|
||||
|
||||
Reference in New Issue
Block a user