Vcs: Standardize on second based timeouts

Change-Id: Ia273fda05a4c4a1934819f26e5dc1b6b80a89f6f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-04-10 14:44:17 +02:00
parent a55fb4a378
commit 7719fb669c
17 changed files with 134 additions and 143 deletions

View File

@@ -620,7 +620,7 @@ void CvsPlugin::revertAll()
QStringList args;
args << QLatin1String("update") << QLatin1String("-C") << state.topLevel();
const CvsResponse revertResponse =
runCvs(state.topLevel(), args, client()->vcsTimeout(),
runCvs(state.topLevel(), args, client()->vcsTimeoutS(),
SshPasswordPrompt|ShowStdOutInLogWindow);
if (revertResponse.result == CvsResponse::Ok)
cvsVersionControl()->emitRepositoryChanged(state.topLevel());
@@ -636,7 +636,7 @@ void CvsPlugin::revertCurrentFile()
QStringList args;
args << QLatin1String("diff") << state.relativeCurrentFile();
const CvsResponse diffResponse =
runCvs(state.currentFileTopLevel(), args, client()->vcsTimeout(), 0);
runCvs(state.currentFileTopLevel(), args, client()->vcsTimeoutS(), 0);
switch (diffResponse.result) {
case CvsResponse::Ok:
return; // Not modified, diff exit code 0
@@ -658,7 +658,7 @@ void CvsPlugin::revertCurrentFile()
args.clear();
args << QLatin1String("update") << QLatin1String("-C") << state.relativeCurrentFile();
const CvsResponse revertResponse =
runCvs(state.currentFileTopLevel(), args, client()->vcsTimeout(),
runCvs(state.currentFileTopLevel(), args, client()->vcsTimeoutS(),
SshPasswordPrompt|ShowStdOutInLogWindow);
if (revertResponse.result == CvsResponse::Ok)
cvsVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
@@ -720,7 +720,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
// where we are, so, have stdout/stderr channels merged.
QStringList args = QStringList(QLatin1String("status"));
const CvsResponse response =
runCvs(workingDir, args, client()->vcsTimeout(), MergeOutputChannels);
runCvs(workingDir, args, client()->vcsTimeoutS(), MergeOutputChannels);
if (response.result != CvsResponse::Ok)
return;
// Get list of added/modified/deleted files and purge out undesired ones
@@ -768,7 +768,7 @@ bool CvsPlugin::commit(const QString &messageFile,
args << QLatin1String("-F") << messageFile;
args.append(fileList);
const CvsResponse response =
runCvs(m_commitRepository, args, 10 * client()->vcsTimeout(),
runCvs(m_commitRepository, args, 10 * client()->vcsTimeoutS(),
SshPasswordPrompt|ShowStdOutInLogWindow);
return response.result == CvsResponse::Ok ;
}
@@ -806,7 +806,7 @@ void CvsPlugin::filelog(const QString &workingDir,
args << QLatin1String("log");
args.append(file);
const CvsResponse response =
runCvs(workingDir, args, client()->vcsTimeout(),
runCvs(workingDir, args, client()->vcsTimeoutS(),
SshPasswordPrompt, codec);
if (response.result != CvsResponse::Ok)
return;
@@ -847,7 +847,7 @@ bool CvsPlugin::update(const QString &topLevel, const QString &file)
if (!file.isEmpty())
args.append(file);
const CvsResponse response =
runCvs(topLevel, args, 10 * client()->vcsTimeout(),
runCvs(topLevel, args, 10 * client()->vcsTimeoutS(),
SshPasswordPrompt|ShowStdOutInLogWindow);
const bool ok = response.result == CvsResponse::Ok;
if (ok)
@@ -894,7 +894,7 @@ bool CvsPlugin::edit(const QString &topLevel, const QStringList &files)
QStringList args(QLatin1String("edit"));
args.append(files);
const CvsResponse response =
runCvs(topLevel, args, client()->vcsTimeout(),
runCvs(topLevel, args, client()->vcsTimeoutS(),
ShowStdOutInLogWindow|SshPasswordPrompt);
return response.result == CvsResponse::Ok;
}
@@ -906,7 +906,7 @@ bool CvsPlugin::diffCheckModified(const QString &topLevel, const QStringList &fi
QStringList args(QLatin1String("-q"));
args << QLatin1String("diff");
args.append(files);
const CvsResponse response = runCvs(topLevel, args, client()->vcsTimeout(), 0);
const CvsResponse response = runCvs(topLevel, args, client()->vcsTimeoutS(), 0);
if (response.result == CvsResponse::OtherError)
return false;
*modified = response.result == CvsResponse::NonNullExitCode;
@@ -934,7 +934,7 @@ bool CvsPlugin::unedit(const QString &topLevel, const QStringList &files)
args.append(QLatin1String("-y"));
args.append(files);
const CvsResponse response =
runCvs(topLevel, args, client()->vcsTimeout(),
runCvs(topLevel, args, client()->vcsTimeoutS(),
ShowStdOutInLogWindow|SshPasswordPrompt);
return response.result == CvsResponse::Ok;
}
@@ -953,7 +953,7 @@ void CvsPlugin::annotate(const QString &workingDir, const QString &file,
args << QLatin1String("-r") << revision;
args << file;
const CvsResponse response =
runCvs(workingDir, args, client()->vcsTimeout(),
runCvs(workingDir, args, client()->vcsTimeoutS(),
SshPasswordPrompt, codec);
if (response.result != CvsResponse::Ok)
return;
@@ -982,7 +982,7 @@ bool CvsPlugin::status(const QString &topLevel, const QString &file, const QStri
if (!file.isEmpty())
args.append(file);
const CvsResponse response =
runCvs(topLevel, args, client()->vcsTimeout(), 0);
runCvs(topLevel, args, client()->vcsTimeoutS(), 0);
const bool ok = response.result == CvsResponse::Ok;
if (ok)
showOutputInEditor(title, response.stdOut, OtherContent, topLevel, 0);
@@ -1065,7 +1065,7 @@ bool CvsPlugin::describe(const QString &toplevel, const QString &file, const
QStringList args;
args << QLatin1String("log") << (QLatin1String("-r") + changeNr) << file;
const CvsResponse logResponse =
runCvs(toplevel, args, client()->vcsTimeout(), SshPasswordPrompt);
runCvs(toplevel, args, client()->vcsTimeoutS(), SshPasswordPrompt);
if (logResponse.result != CvsResponse::Ok) {
*errorMessage = logResponse.message;
return false;
@@ -1087,7 +1087,7 @@ bool CvsPlugin::describe(const QString &toplevel, const QString &file, const
args << QLatin1String("log") << QLatin1String("-d") << (dateS + QLatin1Char('<') + nextDayS);
const CvsResponse repoLogResponse =
runCvs(toplevel, args, 10 * client()->vcsTimeout(), SshPasswordPrompt);
runCvs(toplevel, args, 10 * client()->vcsTimeoutS(), SshPasswordPrompt);
if (repoLogResponse.result != CvsResponse::Ok) {
*errorMessage = repoLogResponse.message;
return false;
@@ -1124,7 +1124,7 @@ bool CvsPlugin::describe(const QString &repositoryPath,
QStringList args(QLatin1String("log"));
args << (QLatin1String("-r") + it->revisions.front().revision) << it->file;
const CvsResponse logResponse =
runCvs(repositoryPath, args, client()->vcsTimeout(), SshPasswordPrompt);
runCvs(repositoryPath, args, client()->vcsTimeoutS(), SshPasswordPrompt);
if (logResponse.result != CvsResponse::Ok) {
*errorMessage = logResponse.message;
return false;
@@ -1141,7 +1141,7 @@ bool CvsPlugin::describe(const QString &repositoryPath,
<< QLatin1String("-r") << previousRev << QLatin1String("-r")
<< it->revisions.front().revision << it->file;
const CvsResponse diffResponse =
runCvs(repositoryPath, args, client()->vcsTimeout(), 0, codec);
runCvs(repositoryPath, args, client()->vcsTimeoutS(), 0, codec);
switch (diffResponse.result) {
case CvsResponse::Ok:
case CvsResponse::NonNullExitCode: // Diff exit code != 0
@@ -1185,7 +1185,7 @@ void CvsPlugin::submitCurrentLog()
// the working directory (see above).
CvsResponse CvsPlugin::runCvs(const QString &workingDirectory,
const QStringList &arguments,
int timeOut,
int timeOutS,
unsigned flags,
QTextCodec *outputCodec) const
{
@@ -1199,7 +1199,7 @@ CvsResponse CvsPlugin::runCvs(const QString &workingDirectory,
// Run, connect stderr to the output window
const SynchronousProcessResponse sp_resp =
runVcs(workingDirectory, executable, client()->settings().addOptions(arguments),
timeOut, flags, outputCodec);
timeOutS, flags, outputCodec);
response.result = CvsResponse::OtherError;
response.stdErr = sp_resp.stdErr;
@@ -1218,7 +1218,7 @@ CvsResponse CvsPlugin::runCvs(const QString &workingDirectory,
}
if (response.result != CvsResponse::Ok)
response.message = sp_resp.exitMessage(executable.toString(), timeOut);
response.message = sp_resp.exitMessage(executable.toString(), timeOutS);
return response;
}
@@ -1261,7 +1261,7 @@ bool CvsPlugin::vcsAdd(const QString &workingDir, const QString &rawFileName)
QStringList args;
args << QLatin1String("add") << rawFileName;
const CvsResponse response =
runCvs(workingDir, args, client()->vcsTimeout(),
runCvs(workingDir, args, client()->vcsTimeoutS(),
SshPasswordPrompt|ShowStdOutInLogWindow);
return response.result == CvsResponse::Ok;
}
@@ -1271,7 +1271,7 @@ bool CvsPlugin::vcsDelete(const QString &workingDir, const QString &rawFileName)
QStringList args;
args << QLatin1String("remove") << QLatin1String("-f") << rawFileName;
const CvsResponse response =
runCvs(workingDir, args, client()->vcsTimeout(),
runCvs(workingDir, args, client()->vcsTimeoutS(),
SshPasswordPrompt|ShowStdOutInLogWindow);
return response.result == CvsResponse::Ok;
}
@@ -1317,7 +1317,7 @@ bool CvsPlugin::managesFile(const QString &workingDirectory, const QString &file
QStringList args;
args << QLatin1String("status") << fileName;
const CvsResponse response =
runCvs(workingDirectory, args, client()->vcsTimeout(), SshPasswordPrompt);
runCvs(workingDirectory, args, client()->vcsTimeoutS(), SshPasswordPrompt);
if (response.result != CvsResponse::Ok)
return false;
return !response.stdOut.contains(QLatin1String("Status: Unknown"));