Commit 7719fb66 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Vcs: Standardize on second based timeouts



Change-Id: Ia273fda05a4c4a1934819f26e5dc1b6b80a89f6f
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent a55fb4a3
......@@ -232,7 +232,7 @@ QStringList ClearCasePlugin::getVobList() const
QStringList args(QLatin1String("lsvob"));
args << QLatin1String("-s");
const ClearCaseResponse response =
runCleartool(currentState().topLevel(), args, m_settings.timeOutMS(), SilentRun);
runCleartool(currentState().topLevel(), args, m_settings.timeOutS, SilentRun);
return response.stdOut.split(QLatin1Char('\n'), QString::SkipEmptyParts);
}
......@@ -356,7 +356,7 @@ QString ClearCasePlugin::ccManagesDirectory(const QString &directory) const
{
QStringList args(QLatin1String("pwv"));
const ClearCaseResponse response =
runCleartool(directory, args, m_settings.timeOutMS(), SilentRun);
runCleartool(directory, args, m_settings.timeOutS, SilentRun);
if (response.error)
return QString();
......@@ -404,7 +404,7 @@ QString ClearCasePlugin::ccViewRoot(const QString &directory) const
QStringList args(QLatin1String("pwv"));
args << QLatin1String("-root");
const ClearCaseResponse response =
runCleartool(directory, args, m_settings.timeOutMS(), SilentRun);
runCleartool(directory, args, m_settings.timeOutS, SilentRun);
QString root = response.stdOut.trimmed();
......@@ -706,7 +706,7 @@ QString ClearCasePlugin::ccGetPredecessor(const QString &version) const
QStringList args(QLatin1String("describe"));
args << QLatin1String("-fmt") << QLatin1String("%En@@%PSn") << version;
const ClearCaseResponse response =
runCleartool(currentState().topLevel(), args, m_settings.timeOutMS(), SilentRun);
runCleartool(currentState().topLevel(), args, m_settings.timeOutS, SilentRun);
if (response.error || response.stdOut.endsWith(QLatin1Char('@'))) // <name-unknown>@@
return QString();
else
......@@ -722,7 +722,7 @@ QStringList ClearCasePlugin::ccGetActiveVobs() const
const QString theViewRoot = viewRoot();
const ClearCaseResponse response =
runCleartool(theViewRoot, args, m_settings.timeOutMS(), SilentRun);
runCleartool(theViewRoot, args, m_settings.timeOutS, SilentRun);
if (response.error)
return res;
......@@ -774,7 +774,7 @@ QString ClearCasePlugin::ccGetFileActivity(const QString &workingDir, const QStr
args << QLatin1String("-fmt") << QLatin1String("%[activity]p");
args << file;
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(), SilentRun);
runCleartool(workingDir, args, m_settings.timeOutS, SilentRun);
return response.stdOut;
}
......@@ -911,7 +911,7 @@ void ClearCasePlugin::undoCheckOutCurrent()
args << fileName;
const ClearCaseResponse diffResponse =
runCleartool(state.currentFileTopLevel(), args, m_settings.timeOutMS(), 0);
runCleartool(state.currentFileTopLevel(), args, m_settings.timeOutS, 0);
bool different = diffResponse.error; // return value is 1 if there is any difference
bool keep = false;
......@@ -940,7 +940,7 @@ bool ClearCasePlugin::vcsUndoCheckOut(const QString &workingDir, const QString &
args << QDir::toNativeSeparators(fileName);
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(),
runCleartool(workingDir, args, m_settings.timeOutS,
ShowStdOutInLogWindow | FullySynchronously);
if (!response.error) {
......@@ -973,7 +973,7 @@ bool ClearCasePlugin::vcsUndoHijack(const QString &workingDir, const QString &fi
args << QDir::toNativeSeparators(fileName);
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(),
runCleartool(workingDir, args, m_settings.timeOutS,
ShowStdOutInLogWindow | FullySynchronously);
if (!response.error && !m_settings.disableIndexer) {
const QString absPath = workingDir + QLatin1Char('/') + fileName;
......@@ -1080,7 +1080,7 @@ QStringList ClearCasePlugin::ccGetActivityVersions(const QString &workingDir, co
QStringList args(QLatin1String("lsactivity"));
args << QLatin1String("-fmt") << QLatin1String("%[versions]Cp") << activity;
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(), SilentRun);
runCleartool(workingDir, args, m_settings.timeOutS, SilentRun);
if (response.error)
return QStringList();
QStringList versions = response.stdOut.split(QLatin1String(", "));
......@@ -1306,8 +1306,7 @@ void ClearCasePlugin::history(const QString &workingDir,
args.append(QDir::toNativeSeparators(file));
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(),
0, codec);
runCleartool(workingDir, args, m_settings.timeOutS, 0, codec);
if (response.error)
return;
......@@ -1367,7 +1366,7 @@ void ClearCasePlugin::ccUpdate(const QString &workingDir, const QStringList &rel
if (!relativePaths.isEmpty())
args.append(relativePaths);
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.longTimeOutMS(), ShowStdOutInLogWindow);
runCleartool(workingDir, args, m_settings.longTimeOutS(), ShowStdOutInLogWindow);
if (!response.error)
clearCaseControl()->emitRepositoryChanged(workingDir);
}
......@@ -1408,7 +1407,7 @@ void ClearCasePlugin::vcsAnnotate(const QString &workingDir, const QString &file
args.append(QDir::toNativeSeparators(id));
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(), 0, codec);
runCleartool(workingDir, args, m_settings.timeOutS, 0, codec);
if (response.error)
return;
......@@ -1458,7 +1457,7 @@ void ClearCasePlugin::describe(const QString &source, const QString &changeNr)
args.push_back(id);
QTextCodec *codec = VcsBaseEditor::getCodec(source);
const ClearCaseResponse response =
runCleartool(topLevel, args, m_settings.timeOutMS(), 0, codec);
runCleartool(topLevel, args, m_settings.timeOutS, 0, codec);
description = response.stdOut;
if (m_settings.extDiffAvailable)
description += diffExternal(id);
......@@ -1486,13 +1485,13 @@ void ClearCasePlugin::checkInSelected()
QString ClearCasePlugin::runCleartoolSync(const QString &workingDir,
const QStringList &arguments) const
{
return runCleartool(workingDir, arguments, m_settings.timeOutMS(), SilentRun).stdOut;
return runCleartool(workingDir, arguments, m_settings.timeOutS, SilentRun).stdOut;
}
ClearCaseResponse
ClearCasePlugin::runCleartool(const QString &workingDir,
const QStringList &arguments,
int timeOut,
int timeOutS,
unsigned flags,
QTextCodec *outputCodec) const
{
......@@ -1506,12 +1505,12 @@ ClearCasePlugin::runCleartool(const QString &workingDir,
const SynchronousProcessResponse sp_resp =
VcsBasePlugin::runVcs(workingDir, FileName::fromUserInput(executable),
arguments, timeOut,
arguments, timeOutS,
flags, outputCodec);
response.error = sp_resp.result != SynchronousProcessResponse::Finished;
if (response.error)
response.message = sp_resp.exitMessage(executable, timeOut);
response.message = sp_resp.exitMessage(executable, timeOutS);
response.stdErr = sp_resp.stdErr;
response.stdOut = sp_resp.stdOut;
return response;
......@@ -1629,7 +1628,7 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
}
args << file;
ClearCaseResponse response =
runCleartool(topLevel, args, m_settings.timeOutMS(), ShowStdOutInLogWindow |
runCleartool(topLevel, args, m_settings.timeOutS, ShowStdOutInLogWindow |
SuppressStdErrInLogWindow | FullySynchronously);
if (response.error) {
if (response.stdErr.contains(QLatin1String("Versions other than the selected version"))) {
......@@ -1639,7 +1638,7 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
ccUpdate(workingDir, QStringList() << file);
else
args.removeOne(QLatin1String("-query"));
response = runCleartool(topLevel, args, m_settings.timeOutMS(),
response = runCleartool(topLevel, args, m_settings.timeOutS,
ShowStdOutInLogWindow | FullySynchronously);
}
} else {
......@@ -1675,7 +1674,7 @@ bool ClearCasePlugin::vcsSetActivity(const QString &workingDir, const QString &t
QStringList args;
args << QLatin1String("setactivity") << activity;
const ClearCaseResponse actResponse =
runCleartool(workingDir, args, m_settings.timeOutMS(), ShowStdOutInLogWindow);
runCleartool(workingDir, args, m_settings.timeOutS, ShowStdOutInLogWindow);
if (actResponse.error) {
QMessageBox::warning(ICore::dialogParent(), title,
tr("Set current activity failed: %1").arg(actResponse.message), QMessageBox::Ok);
......@@ -1719,7 +1718,7 @@ bool ClearCasePlugin::vcsCheckIn(const QString &messageFile, const QStringList &
blockers.append(fcb);
}
const ClearCaseResponse response =
runCleartool(m_checkInView, args, m_settings.longTimeOutMS(), ShowStdOutInLogWindow);
runCleartool(m_checkInView, args, m_settings.longTimeOutS(), ShowStdOutInLogWindow);
QRegExp checkedIn(QLatin1String("Checked in \\\"([^\"]*)\\\""));
bool anySucceeded = false;
int offset = checkedIn.indexIn(response.stdOut);
......@@ -1785,7 +1784,7 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
QStringList args;
args << QLatin1String("checkout") << commentArg << dirName;
const ClearCaseResponse coResponse =
runCleartool(workingDir, args, m_settings.timeOutMS(),
runCleartool(workingDir, args, m_settings.timeOutS,
ShowStdOutInLogWindow | FullySynchronously);
if (coResponse.error) {
if (coResponse.stdErr.contains(QLatin1String("already checked out")))
......@@ -1800,7 +1799,7 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
if (!file2.isEmpty())
args << QDir::toNativeSeparators(file2);
const ClearCaseResponse opResponse =
runCleartool(workingDir, args, m_settings.timeOutMS(),
runCleartool(workingDir, args, m_settings.timeOutS,
ShowStdOutInLogWindow | FullySynchronously);
if (opResponse.error) {
// on failure - undo checkout for the directory
......@@ -1814,7 +1813,7 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
args.clear();
args << QLatin1String("checkin") << commentArg << dirName;
const ClearCaseResponse ciResponse =
runCleartool(workingDir, args, m_settings.timeOutMS(),
runCleartool(workingDir, args, m_settings.timeOutS,
ShowStdOutInLogWindow | FullySynchronously);
return !ciResponse.error;
}
......@@ -1963,7 +1962,7 @@ bool ClearCasePlugin::newActivity()
}
const ClearCaseResponse response =
runCleartool(workingDir, args, m_settings.timeOutMS(), 0);
runCleartool(workingDir, args, m_settings.timeOutS, 0);
if (!response.error)
refreshActivities();
......@@ -2103,7 +2102,7 @@ QString ClearCasePlugin::getFile(const QString &nativeFile, const QString &prefi
QStringList args(QLatin1String("get"));
args << QLatin1String("-to") << tempFile << nativeFile;
const ClearCaseResponse response =
runCleartool(m_topLevel, args, m_settings.timeOutMS(), SilentRun);
runCleartool(m_topLevel, args, m_settings.timeOutS, SilentRun);
if (response.error)
return QString();
QFile::setPermissions(tempFile, QFile::ReadOwner | QFile::ReadUser |
......@@ -2146,8 +2145,7 @@ QString ClearCasePlugin::diffExternal(QString file1, QString file2, bool keep)
} else {
args << file2;
}
const QString diffResponse =
runExtDiff(m_topLevel, args, m_settings.timeOutMS(), codec);
const QString diffResponse = runExtDiff(m_topLevel, args, m_settings.timeOutS, codec);
if (!keep && !tempFile1.isEmpty()) {
QFile::remove(tempFile1);
QFileInfo(tempFile1).dir().rmpath(QLatin1String("."));
......@@ -2179,10 +2177,8 @@ void ClearCasePlugin::diffGraphical(const QString &file1, const QString &file2)
QProcess::startDetached(m_settings.ccBinaryPath, args, m_topLevel);
}
QString ClearCasePlugin::runExtDiff(const QString &workingDir,
const QStringList &arguments,
int timeOut,
QTextCodec *outputCodec)
QString ClearCasePlugin::runExtDiff(const QString &workingDir, const QStringList &arguments,
int timeOutS, QTextCodec *outputCodec)
{
const QString executable(QLatin1String("diff"));
QStringList args(m_settings.diffArgs.split(QLatin1Char(' '), QString::SkipEmptyParts));
......@@ -2191,7 +2187,7 @@ QString ClearCasePlugin::runExtDiff(const QString &workingDir,
QProcess process;
process.setWorkingDirectory(workingDir);
process.start(executable, args);
if (!process.waitForFinished(timeOut))
if (!process.waitForFinished(timeOutS * 1000))
return QString();
QByteArray ba = process.readAll();
return outputCodec ? outputCodec->toUnicode(ba) :
......
......@@ -235,9 +235,8 @@ private:
int editorType, const QString &source,
QTextCodec *codec) const;
QString runCleartoolSync(const QString &workingDir, const QStringList &arguments) const;
ClearCaseResponse runCleartool(const QString &workingDir,
const QStringList &arguments, int timeOut,
unsigned flags, QTextCodec *outputCodec = 0) const;
ClearCaseResponse runCleartool(const QString &workingDir, const QStringList &arguments,
int timeOutS, unsigned flags, QTextCodec *outputCodec = 0) const;
static void sync(QFutureInterface<void> &future, QStringList files);
void history(const QString &workingDir,
......@@ -255,8 +254,8 @@ private:
QString diffExternal(QString file1, QString file2 = QString(), bool keep = false);
QString getFile(const QString &nativeFile, const QString &prefix);
static void rmdir(const QString &path);
QString runExtDiff(const QString &workingDir, const QStringList &arguments,
int timeOut, QTextCodec *outputCodec = 0);
QString runExtDiff(const QString &workingDir, const QStringList &arguments, int timeOutS,
QTextCodec *outputCodec = 0);
static QString getDriveLetterOfPath(const QString &directory);
FileStatus::Status getFileStatus(const QString &fileName) const;
......
......@@ -63,17 +63,16 @@ using namespace ClearCase::Internal;
ClearCaseSettings::ClearCaseSettings() :
ccCommand(defaultCommand()),
historyCount(defaultHistoryCount),
timeOutS(defaultTimeOutS),
diffType(GraphicalDiff),
diffArgs(QLatin1String(defaultDiffArgs)),
autoAssignActivityName(true),
autoCheckOut(true),
promptToCheckIn(false),
disableIndexer(false),
extDiffAvailable(false)
{
}
extDiffAvailable(false),
historyCount(defaultHistoryCount),
timeOutS(defaultTimeOutS)
{ }
void ClearCaseSettings::fromSettings(QSettings *settings)
{
......
......@@ -56,24 +56,23 @@ public:
void fromSettings(QSettings *);
void toSettings(QSettings *) const;
inline int timeOutMS() const { return timeOutS * 1000; }
inline int longTimeOutMS() const { return timeOutS * 10000; }
inline int longTimeOutS() const { return timeOutS * 10; }
bool equals(const ClearCaseSettings &s) const;
QString ccCommand;
QString ccBinaryPath;
int historyCount;
int timeOutS;
DiffType diffType;
QString diffArgs;
QString indexOnlyVOBs;
QHash<QString, int> totalFiles;
bool autoAssignActivityName;
bool autoCheckOut;
bool promptToCheckIn;
bool disableIndexer;
QString indexOnlyVOBs;
bool extDiffAvailable;
QHash<QString, int> totalFiles;
int historyCount;
int timeOutS;
};
inline bool operator==(const ClearCaseSettings &p1, const ClearCaseSettings &p2)
......
......@@ -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"));
......
......@@ -142,7 +142,7 @@ private:
CvsResponse runCvs(const QString &workingDirectory,
const QStringList &arguments,
int timeOut,
int timeOutS,
unsigned flags,
QTextCodec *outputCodec = 0) const;
......
......@@ -157,7 +157,7 @@ void BaseController::runCommand(const QList<QStringList> &args, QTextCodec *code
foreach (const QStringList &arg, args) {
QTC_ASSERT(!arg.isEmpty(), continue);
m_command->addJob(arg, gitClient()->vcsTimeout());
m_command->addJob(arg, gitClient()->vcsTimeoutS());
}
m_command->execute();
......@@ -1998,7 +1998,7 @@ SynchronousProcessResponse GitClient::synchronousGit(const QString &workingDirec
unsigned flags,
QTextCodec *outputCodec) const
{
return VcsBasePlugin::runVcs(workingDirectory, vcsBinary(), gitArguments, vcsTimeout() * 1000,
return VcsBasePlugin::runVcs(workingDirectory, vcsBinary(), gitArguments, vcsTimeoutS(),
flags, outputCodec, processEnvironment());
}
......@@ -2010,8 +2010,7 @@ bool GitClient::fullySynchronousGit(const QString &workingDirectory,
{
VcsCommand command(vcsBinary(), workingDirectory, processEnvironment());
command.addFlags(flags);
return command.runFullySynchronous(gitArguments, vcsTimeout() * 1000,
outputText, errorText);
return command.runFullySynchronous(gitArguments, vcsTimeoutS(), outputText, errorText);
}
void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool prompt)
......
......@@ -159,7 +159,7 @@ bool MercurialClient::synchronousPull(const QString &workingDir, const QString &
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert(QLatin1String("LANGUAGE"), QLatin1String("C"));
const SynchronousProcessResponse resp = VcsBasePlugin::runVcs(
workingDir, vcsBinary(), args, vcsTimeout() * 1000, flags, 0, env);
workingDir, vcsBinary(), args, vcsTimeoutS(), flags, 0, env);
const bool ok = resp.result == SynchronousProcessResponse::Finished;
parsePullOutput(resp.stdOut.trimmed());
......
......@@ -222,7 +222,7 @@ QString DiffController::getDescription() const
args << QString::number(m_changeNumber);
const SubversionResponse logResponse =
SubversionPlugin::instance()->runSvn(m_workingDirectory, args,
m_client->vcsTimeout() * 1000,
m_client->vcsTimeoutS(),
VcsBasePlugin::SshPasswordPrompt);
if (logResponse.error)
......@@ -252,7 +252,7 @@ void DiffController::postCollectTextualDiffOutput()
args << m_filesList;
}
command->addJob(args, m_client->vcsTimeout());
command->addJob(args, m_client->vcsTimeoutS());
command->execute();
}
......