forked from qt-creator/qt-creator
VCS: Introduce configureable timeout to vcs,svn, p4.
as already present for git, mercurial. Task-number: QTCREATORBUG-475
This commit is contained in:
@@ -79,11 +79,6 @@ static inline QString msgLogParsingFailed()
|
|||||||
return CVSPlugin::tr("Parsing of the log output failed");
|
return CVSPlugin::tr("Parsing of the log output failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timeout for normal output commands
|
|
||||||
enum { cvsShortTimeOut = 10000 };
|
|
||||||
// Timeout for submit, update
|
|
||||||
enum { cvsLongTimeOut = 120000 };
|
|
||||||
|
|
||||||
static const char * const CMD_ID_CVS_MENU = "CVS.Menu";
|
static const char * const CMD_ID_CVS_MENU = "CVS.Menu";
|
||||||
static const char * const CMD_ID_ADD = "CVS.Add";
|
static const char * const CMD_ID_ADD = "CVS.Add";
|
||||||
static const char * const CMD_ID_DELETE_FILE = "CVS.Delete";
|
static const char * const CMD_ID_DELETE_FILE = "CVS.Delete";
|
||||||
@@ -434,7 +429,7 @@ void CVSPlugin::cvsDiff(const QString &workingDir, const QStringList &files)
|
|||||||
|
|
||||||
// CVS returns the diff exit code (1 if files differ), which is
|
// CVS returns the diff exit code (1 if files differ), which is
|
||||||
// undistinguishable from a "file not found" error, unfortunately.
|
// undistinguishable from a "file not found" error, unfortunately.
|
||||||
const CVSResponse response = runCVS(workingDir, args, cvsShortTimeOut, false, codec);
|
const CVSResponse response = runCVS(workingDir, args, m_settings.timeOutMS(), false, codec);
|
||||||
switch (response.result) {
|
switch (response.result) {
|
||||||
case CVSResponse::NonNullExitCode:
|
case CVSResponse::NonNullExitCode:
|
||||||
case CVSResponse::Ok:
|
case CVSResponse::Ok:
|
||||||
@@ -518,7 +513,7 @@ void CVSPlugin::revertCurrentFile()
|
|||||||
QTC_ASSERT(state.hasFile(), return)
|
QTC_ASSERT(state.hasFile(), return)
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("diff") << state.relativeCurrentFile();
|
args << QLatin1String("diff") << state.relativeCurrentFile();
|
||||||
const CVSResponse diffResponse = runCVS(state.currentFileTopLevel(), args, cvsShortTimeOut, false);
|
const CVSResponse diffResponse = runCVS(state.currentFileTopLevel(), args, m_settings.timeOutMS(), false);
|
||||||
switch (diffResponse.result) {
|
switch (diffResponse.result) {
|
||||||
case CVSResponse::Ok:
|
case CVSResponse::Ok:
|
||||||
return; // Not modified, diff exit code 0
|
return; // Not modified, diff exit code 0
|
||||||
@@ -539,7 +534,7 @@ void CVSPlugin::revertCurrentFile()
|
|||||||
// revert
|
// revert
|
||||||
args.clear();
|
args.clear();
|
||||||
args << QLatin1String("update") << QLatin1String("-C") << state.relativeCurrentFile();
|
args << QLatin1String("update") << QLatin1String("-C") << state.relativeCurrentFile();
|
||||||
const CVSResponse revertResponse = runCVS(state.currentFileTopLevel(), args, cvsShortTimeOut, true);
|
const CVSResponse revertResponse = runCVS(state.currentFileTopLevel(), args, m_settings.timeOutMS(), true);
|
||||||
if (revertResponse.result == CVSResponse::Ok) {
|
if (revertResponse.result == CVSResponse::Ok) {
|
||||||
fcb.setModifiedReload(true);
|
fcb.setModifiedReload(true);
|
||||||
cvsVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
|
cvsVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
|
||||||
@@ -589,7 +584,7 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files)
|
|||||||
// We need the "Examining <subdir>" stderr output to tell
|
// We need the "Examining <subdir>" stderr output to tell
|
||||||
// where we are, so, have stdout/stderr channels merged.
|
// where we are, so, have stdout/stderr channels merged.
|
||||||
QStringList args = QStringList(QLatin1String("status"));
|
QStringList args = QStringList(QLatin1String("status"));
|
||||||
const CVSResponse response = runCVS(workingDir, args, cvsShortTimeOut, false, 0, true);
|
const CVSResponse response = runCVS(workingDir, args, m_settings.timeOutMS(), false, 0, true);
|
||||||
if (response.result != CVSResponse::Ok)
|
if (response.result != CVSResponse::Ok)
|
||||||
return;
|
return;
|
||||||
// Get list of added/modified/deleted files and purge out undesired ones
|
// Get list of added/modified/deleted files and purge out undesired ones
|
||||||
@@ -638,7 +633,7 @@ bool CVSPlugin::commit(const QString &messageFile,
|
|||||||
QStringList args = QStringList(QLatin1String("commit"));
|
QStringList args = QStringList(QLatin1String("commit"));
|
||||||
args << QLatin1String("-F") << messageFile;
|
args << QLatin1String("-F") << messageFile;
|
||||||
args.append(fileList);
|
args.append(fileList);
|
||||||
const CVSResponse response = runCVS(m_commitRepository, args, cvsLongTimeOut, true);
|
const CVSResponse response = runCVS(m_commitRepository, args, m_settings.longTimeOutMS(), true);
|
||||||
return response.result == CVSResponse::Ok ;
|
return response.result == CVSResponse::Ok ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -658,7 +653,7 @@ void CVSPlugin::filelog(const QString &workingDir, const QStringList &files)
|
|||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("log");
|
args << QLatin1String("log");
|
||||||
args.append(files);
|
args.append(files);
|
||||||
const CVSResponse response = runCVS(workingDir, args, cvsShortTimeOut, false, codec);
|
const CVSResponse response = runCVS(workingDir, args, m_settings.timeOutMS(), false, codec);
|
||||||
if (response.result != CVSResponse::Ok)
|
if (response.result != CVSResponse::Ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -683,7 +678,7 @@ void CVSPlugin::updateProject()
|
|||||||
QStringList args(QLatin1String("update"));
|
QStringList args(QLatin1String("update"));
|
||||||
args.push_back(QLatin1String("-dR"));
|
args.push_back(QLatin1String("-dR"));
|
||||||
args.append(state.relativeCurrentProject());
|
args.append(state.relativeCurrentProject());
|
||||||
const CVSResponse response = runCVS(state.currentProjectTopLevel(), args, cvsLongTimeOut, true);
|
const CVSResponse response = runCVS(state.currentProjectTopLevel(), args, m_settings.longTimeOutMS(), true);
|
||||||
if (response.result == CVSResponse::Ok)
|
if (response.result == CVSResponse::Ok)
|
||||||
cvsVersionControl()->emitRepositoryChanged(state.currentProjectTopLevel());
|
cvsVersionControl()->emitRepositoryChanged(state.currentProjectTopLevel());
|
||||||
}
|
}
|
||||||
@@ -703,7 +698,7 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file)
|
|||||||
const QString source = VCSBase::VCSBaseEditor::getSource(workingDir, file);
|
const QString source = VCSBase::VCSBaseEditor::getSource(workingDir, file);
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("annotate") << file;
|
args << QLatin1String("annotate") << file;
|
||||||
const CVSResponse response = runCVS(workingDir, args, cvsShortTimeOut, false, codec);
|
const CVSResponse response = runCVS(workingDir, args, m_settings.timeOutMS(), false, codec);
|
||||||
if (response.result != CVSResponse::Ok)
|
if (response.result != CVSResponse::Ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -729,7 +724,7 @@ void CVSPlugin::projectStatus()
|
|||||||
QTC_ASSERT(state.hasProject(), return)
|
QTC_ASSERT(state.hasProject(), return)
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("status") << state.relativeCurrentProject();
|
args << QLatin1String("status") << state.relativeCurrentProject();
|
||||||
const CVSResponse response = runCVS(state.currentProjectTopLevel(), args, cvsShortTimeOut, false);
|
const CVSResponse response = runCVS(state.currentProjectTopLevel(), args, m_settings.timeOutMS(), false);
|
||||||
if (response.result == CVSResponse::Ok)
|
if (response.result == CVSResponse::Ok)
|
||||||
showOutputInEditor(tr("Project status"), response.stdOut, VCSBase::RegularCommandOutput, state.currentProjectTopLevel(), 0);
|
showOutputInEditor(tr("Project status"), response.stdOut, VCSBase::RegularCommandOutput, state.currentProjectTopLevel(), 0);
|
||||||
}
|
}
|
||||||
@@ -787,7 +782,7 @@ bool CVSPlugin::describe(const QString &toplevel, const QString &file, const
|
|||||||
// Run log to obtain commit id and details
|
// Run log to obtain commit id and details
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("log") << (QLatin1String("-r") + changeNr) << file;
|
args << QLatin1String("log") << (QLatin1String("-r") + changeNr) << file;
|
||||||
const CVSResponse logResponse = runCVS(toplevel, args, cvsShortTimeOut, false);
|
const CVSResponse logResponse = runCVS(toplevel, args, m_settings.timeOutMS(), false);
|
||||||
if (logResponse.result != CVSResponse::Ok) {
|
if (logResponse.result != CVSResponse::Ok) {
|
||||||
*errorMessage = logResponse.message;
|
*errorMessage = logResponse.message;
|
||||||
return false;
|
return false;
|
||||||
@@ -808,7 +803,7 @@ bool CVSPlugin::describe(const QString &toplevel, const QString &file, const
|
|||||||
args.clear();
|
args.clear();
|
||||||
args << QLatin1String("log") << QLatin1String("-d") << (dateS + QLatin1Char('<') + nextDayS);
|
args << QLatin1String("log") << QLatin1String("-d") << (dateS + QLatin1Char('<') + nextDayS);
|
||||||
|
|
||||||
const CVSResponse repoLogResponse = runCVS(toplevel, args, cvsLongTimeOut, false);
|
const CVSResponse repoLogResponse = runCVS(toplevel, args, m_settings.longTimeOutMS(), false);
|
||||||
if (repoLogResponse.result != CVSResponse::Ok) {
|
if (repoLogResponse.result != CVSResponse::Ok) {
|
||||||
*errorMessage = repoLogResponse.message;
|
*errorMessage = repoLogResponse.message;
|
||||||
return false;
|
return false;
|
||||||
@@ -844,7 +839,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
|
|||||||
// Run log
|
// Run log
|
||||||
QStringList args(QLatin1String("log"));
|
QStringList args(QLatin1String("log"));
|
||||||
args << (QLatin1String("-r") + it->revisions.front().revision) << it->file;
|
args << (QLatin1String("-r") + it->revisions.front().revision) << it->file;
|
||||||
const CVSResponse logResponse = runCVS(repositoryPath, args, cvsShortTimeOut, false);
|
const CVSResponse logResponse = runCVS(repositoryPath, args, m_settings.timeOutMS(), false);
|
||||||
if (logResponse.result != CVSResponse::Ok) {
|
if (logResponse.result != CVSResponse::Ok) {
|
||||||
*errorMessage = logResponse.message;
|
*errorMessage = logResponse.message;
|
||||||
return false;
|
return false;
|
||||||
@@ -860,7 +855,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
|
|||||||
args << m_settings.cvsDiffOptions << QLatin1String("-r") << previousRev
|
args << m_settings.cvsDiffOptions << QLatin1String("-r") << previousRev
|
||||||
<< QLatin1String("-r") << it->revisions.front().revision
|
<< QLatin1String("-r") << it->revisions.front().revision
|
||||||
<< it->file;
|
<< it->file;
|
||||||
const CVSResponse diffResponse = runCVS(repositoryPath, args, cvsShortTimeOut, false, codec);
|
const CVSResponse diffResponse = runCVS(repositoryPath, args, m_settings.timeOutMS(), false, codec);
|
||||||
switch (diffResponse.result) {
|
switch (diffResponse.result) {
|
||||||
case CVSResponse::Ok:
|
case CVSResponse::Ok:
|
||||||
case CVSResponse::NonNullExitCode: // Diff exit code != 0
|
case CVSResponse::NonNullExitCode: // Diff exit code != 0
|
||||||
@@ -1037,7 +1032,7 @@ bool CVSPlugin::vcsAdd(const QString &workingDir, const QString &rawFileName)
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("add") << rawFileName;
|
args << QLatin1String("add") << rawFileName;
|
||||||
const CVSResponse response = runCVS(workingDir, args, cvsShortTimeOut, true);
|
const CVSResponse response = runCVS(workingDir, args, m_settings.timeOutMS(), true);
|
||||||
return response.result == CVSResponse::Ok;
|
return response.result == CVSResponse::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1045,7 +1040,7 @@ bool CVSPlugin::vcsDelete(const QString &workingDir, const QString &rawFileName)
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("remove") << QLatin1String("-f") << rawFileName;
|
args << QLatin1String("remove") << QLatin1String("-f") << rawFileName;
|
||||||
const CVSResponse response = runCVS(workingDir, args, cvsShortTimeOut, true);
|
const CVSResponse response = runCVS(workingDir, args, m_settings.timeOutMS(), true);
|
||||||
return response.result == CVSResponse::Ok;
|
return response.result == CVSResponse::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -39,6 +39,9 @@ static const char *promptToSubmitKeyC = "PromptForSubmit";
|
|||||||
static const char *diffOptionsKeyC = "DiffOptions";
|
static const char *diffOptionsKeyC = "DiffOptions";
|
||||||
static const char *describeByCommitIdKeyC = "DescribeByCommitId";
|
static const char *describeByCommitIdKeyC = "DescribeByCommitId";
|
||||||
static const char *defaultDiffOptions = "-du";
|
static const char *defaultDiffOptions = "-du";
|
||||||
|
static const char *timeOutKeyC = "TimeOut";
|
||||||
|
|
||||||
|
enum { defaultTimeOutS = 30 };
|
||||||
|
|
||||||
static QString defaultCommand()
|
static QString defaultCommand()
|
||||||
{
|
{
|
||||||
@@ -56,6 +59,7 @@ namespace CVS {
|
|||||||
CVSSettings::CVSSettings() :
|
CVSSettings::CVSSettings() :
|
||||||
cvsCommand(defaultCommand()),
|
cvsCommand(defaultCommand()),
|
||||||
cvsDiffOptions(QLatin1String(defaultDiffOptions)),
|
cvsDiffOptions(QLatin1String(defaultDiffOptions)),
|
||||||
|
timeOutS(defaultTimeOutS),
|
||||||
promptToSubmit(true),
|
promptToSubmit(true),
|
||||||
describeByCommitId(true)
|
describeByCommitId(true)
|
||||||
{
|
{
|
||||||
@@ -69,6 +73,7 @@ void CVSSettings::fromSettings(QSettings *settings)
|
|||||||
cvsRoot = settings->value(QLatin1String(rootC), QString()).toString();
|
cvsRoot = settings->value(QLatin1String(rootC), QString()).toString();
|
||||||
cvsDiffOptions = settings->value(QLatin1String(diffOptionsKeyC), QLatin1String(defaultDiffOptions)).toString();
|
cvsDiffOptions = settings->value(QLatin1String(diffOptionsKeyC), QLatin1String(defaultDiffOptions)).toString();
|
||||||
describeByCommitId = settings->value(QLatin1String(describeByCommitIdKeyC), true).toBool();
|
describeByCommitId = settings->value(QLatin1String(describeByCommitIdKeyC), true).toBool();
|
||||||
|
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +84,7 @@ void CVSSettings::toSettings(QSettings *settings) const
|
|||||||
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
|
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
|
||||||
settings->setValue(QLatin1String(rootC), cvsRoot);
|
settings->setValue(QLatin1String(rootC), cvsRoot);
|
||||||
settings->setValue(QLatin1String(diffOptionsKeyC), cvsDiffOptions);
|
settings->setValue(QLatin1String(diffOptionsKeyC), cvsDiffOptions);
|
||||||
|
settings->setValue(QLatin1String(timeOutKeyC), timeOutS);
|
||||||
settings->setValue(QLatin1String(describeByCommitIdKeyC), describeByCommitId);
|
settings->setValue(QLatin1String(describeByCommitIdKeyC), describeByCommitId);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
@@ -89,6 +95,7 @@ bool CVSSettings::equals(const CVSSettings &s) const
|
|||||||
&& describeByCommitId == s.describeByCommitId
|
&& describeByCommitId == s.describeByCommitId
|
||||||
&& cvsCommand == s.cvsCommand
|
&& cvsCommand == s.cvsCommand
|
||||||
&& cvsRoot == s.cvsRoot
|
&& cvsRoot == s.cvsRoot
|
||||||
|
&& timeOutS == s.timeOutS
|
||||||
&& cvsDiffOptions == s.cvsDiffOptions;
|
&& cvsDiffOptions == s.cvsDiffOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,6 +46,9 @@ struct CVSSettings
|
|||||||
void fromSettings(QSettings *);
|
void fromSettings(QSettings *);
|
||||||
void toSettings(QSettings *) const;
|
void toSettings(QSettings *) const;
|
||||||
|
|
||||||
|
inline int timeOutMS() const { return timeOutS * 10000; }
|
||||||
|
inline int longTimeOutMS() const { return timeOutS * 100000; }
|
||||||
|
|
||||||
// Add common options to the command line
|
// Add common options to the command line
|
||||||
QStringList addOptions(const QStringList &args) const;
|
QStringList addOptions(const QStringList &args) const;
|
||||||
|
|
||||||
@@ -54,6 +57,7 @@ struct CVSSettings
|
|||||||
QString cvsCommand;
|
QString cvsCommand;
|
||||||
QString cvsRoot;
|
QString cvsRoot;
|
||||||
QString cvsDiffOptions;
|
QString cvsDiffOptions;
|
||||||
|
int timeOutS;
|
||||||
bool promptToSubmit;
|
bool promptToSubmit;
|
||||||
bool describeByCommitId;
|
bool describeByCommitId;
|
||||||
};
|
};
|
||||||
|
@@ -57,6 +57,7 @@ CVSSettings SettingsPageWidget::settings() const
|
|||||||
rc.cvsCommand = m_ui.commandPathChooser->path();
|
rc.cvsCommand = m_ui.commandPathChooser->path();
|
||||||
rc.cvsRoot = m_ui.rootLineEdit->text();
|
rc.cvsRoot = m_ui.rootLineEdit->text();
|
||||||
rc.cvsDiffOptions = m_ui.diffOptionsLineEdit->text();
|
rc.cvsDiffOptions = m_ui.diffOptionsLineEdit->text();
|
||||||
|
rc.timeOutS = m_ui.timeOutSpinBox->value();
|
||||||
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
||||||
rc.describeByCommitId = m_ui.describeByCommitIdCheckBox->isChecked();
|
rc.describeByCommitId = m_ui.describeByCommitIdCheckBox->isChecked();
|
||||||
return rc;
|
return rc;
|
||||||
@@ -67,6 +68,7 @@ void SettingsPageWidget::setSettings(const CVSSettings &s)
|
|||||||
m_ui.commandPathChooser->setPath(s.cvsCommand);
|
m_ui.commandPathChooser->setPath(s.cvsCommand);
|
||||||
m_ui.rootLineEdit->setText(s.cvsRoot);
|
m_ui.rootLineEdit->setText(s.cvsRoot);
|
||||||
m_ui.diffOptionsLineEdit->setText(s.cvsDiffOptions);
|
m_ui.diffOptionsLineEdit->setText(s.cvsDiffOptions);
|
||||||
|
m_ui.timeOutSpinBox->setValue(s.timeOutS);
|
||||||
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
|
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
|
||||||
m_ui.describeByCommitIdCheckBox->setChecked(s.describeByCommitId);
|
m_ui.describeByCommitIdCheckBox->setChecked(s.describeByCommitId);
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,14 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CVS::Internal::SettingsPage</class>
|
<class>CVS::Internal::SettingsPage</class>
|
||||||
<widget class="QWidget" name="CVS::Internal::SettingsPage">
|
<widget class="QWidget" name="CVS::Internal::SettingsPage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>447</width>
|
||||||
|
<height>281</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="miscGroupBox">
|
<widget class="QGroupBox" name="miscGroupBox">
|
||||||
@@ -38,24 +46,24 @@
|
|||||||
<string>Miscellaneous</string>
|
<string>Miscellaneous</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="diffOptionsLabel">
|
<widget class="QLabel" name="diffOptionsLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Diff Options:</string>
|
<string>Diff Options:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="diffOptionsLineEdit"/>
|
<widget class="QLineEdit" name="diffOptionsLineEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prompt on submit</string>
|
<string>Prompt on submit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="describeByCommitIdCheckBox">
|
<widget class="QCheckBox" name="describeByCommitIdCheckBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed.</string>
|
<string>When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed.</string>
|
||||||
@@ -65,6 +73,26 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="timeOutLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Timeout:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="timeOutSpinBox">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>360</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@@ -91,12 +91,15 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="timeoutLabel">
|
<widget class="QLabel" name="timeoutLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Timeout (seconds):</string>
|
<string>Timeout:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="timeoutSpinBox">
|
<widget class="QSpinBox" name="timeoutSpinBox">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
|
@@ -68,9 +68,6 @@
|
|||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
|
|
||||||
enum { p4Timeout = 20000 };
|
|
||||||
enum { longTimeoutFactor = 4 };
|
|
||||||
|
|
||||||
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||||
{
|
{
|
||||||
VCSBase::RegularCommandOutput,
|
VCSBase::RegularCommandOutput,
|
||||||
@@ -895,7 +892,7 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
|
|||||||
VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance();
|
VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance();
|
||||||
// Run, connect stderr to the output window
|
// Run, connect stderr to the output window
|
||||||
Utils::SynchronousProcess process;
|
Utils::SynchronousProcess process;
|
||||||
const int timeOut = (flags & LongTimeOut) ? longTimeoutFactor * p4Timeout : p4Timeout;
|
const int timeOut = (flags & LongTimeOut) ? m_settings.longTimeOutMS() : m_settings.timeOutMS();
|
||||||
process.setTimeout(timeOut);
|
process.setTimeout(timeOut);
|
||||||
process.setStdOutCodec(outputCodec);
|
process.setStdOutCodec(outputCodec);
|
||||||
if (flags & OverrideDiffEnvironment)
|
if (flags & OverrideDiffEnvironment)
|
||||||
@@ -983,7 +980,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
|
|||||||
process.closeWriteChannel();
|
process.closeWriteChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
const int timeOut = (flags & LongTimeOut) ? longTimeoutFactor * p4Timeout : p4Timeout;
|
const int timeOut = (flags & LongTimeOut) ? m_settings.longTimeOutMS() : m_settings.timeOutMS();
|
||||||
if (!process.waitForFinished(timeOut)) {
|
if (!process.waitForFinished(timeOut)) {
|
||||||
PerforceChecker::ensureProcessStopped(process);
|
PerforceChecker::ensureProcessStopped(process);
|
||||||
response.error = true;
|
response.error = true;
|
||||||
|
@@ -46,6 +46,9 @@ static const char *portKeyC = "Port";
|
|||||||
static const char *clientKeyC = "Client";
|
static const char *clientKeyC = "Client";
|
||||||
static const char *userKeyC = "User";
|
static const char *userKeyC = "User";
|
||||||
static const char *promptToSubmitKeyC = "PromptForSubmit";
|
static const char *promptToSubmitKeyC = "PromptForSubmit";
|
||||||
|
static const char *timeOutKeyC = "TimeOut";
|
||||||
|
|
||||||
|
enum { defaultTimeOutS = 30 };
|
||||||
|
|
||||||
static QString defaultCommand()
|
static QString defaultCommand()
|
||||||
{
|
{
|
||||||
@@ -62,6 +65,7 @@ namespace Internal {
|
|||||||
|
|
||||||
Settings::Settings() :
|
Settings::Settings() :
|
||||||
defaultEnv(true),
|
defaultEnv(true),
|
||||||
|
timeOutS(defaultTimeOutS),
|
||||||
promptToSubmit(true)
|
promptToSubmit(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -71,7 +75,7 @@ bool Settings::equals(const Settings &rhs) const
|
|||||||
return defaultEnv == rhs.defaultEnv
|
return defaultEnv == rhs.defaultEnv
|
||||||
&& p4Command == rhs.p4Command && p4Port == rhs.p4Port
|
&& p4Command == rhs.p4Command && p4Port == rhs.p4Port
|
||||||
&& p4Client == rhs.p4Client && p4User == rhs.p4User
|
&& p4Client == rhs.p4Client && p4User == rhs.p4User
|
||||||
&& promptToSubmit == rhs.promptToSubmit;
|
&& timeOutS == rhs.timeOutS && promptToSubmit == rhs.promptToSubmit;
|
||||||
};
|
};
|
||||||
|
|
||||||
QStringList Settings::commonP4Arguments() const
|
QStringList Settings::commonP4Arguments() const
|
||||||
@@ -105,6 +109,7 @@ void PerforceSettings::fromSettings(QSettings *settings)
|
|||||||
m_settings.p4Port = settings->value(QLatin1String(portKeyC), QString()).toString();
|
m_settings.p4Port = settings->value(QLatin1String(portKeyC), QString()).toString();
|
||||||
m_settings.p4Client = settings->value(QLatin1String(clientKeyC), QString()).toString();
|
m_settings.p4Client = settings->value(QLatin1String(clientKeyC), QString()).toString();
|
||||||
m_settings.p4User = settings->value(QLatin1String(userKeyC), QString()).toString();
|
m_settings.p4User = settings->value(QLatin1String(userKeyC), QString()).toString();
|
||||||
|
m_settings.timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
||||||
m_settings.promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
|
m_settings.promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
@@ -117,6 +122,7 @@ void PerforceSettings::toSettings(QSettings *settings) const
|
|||||||
settings->setValue(QLatin1String(portKeyC), m_settings.p4Port);
|
settings->setValue(QLatin1String(portKeyC), m_settings.p4Port);
|
||||||
settings->setValue(QLatin1String(clientKeyC), m_settings.p4Client);
|
settings->setValue(QLatin1String(clientKeyC), m_settings.p4Client);
|
||||||
settings->setValue(QLatin1String(userKeyC), m_settings.p4User);
|
settings->setValue(QLatin1String(userKeyC), m_settings.p4User);
|
||||||
|
settings->setValue(QLatin1String(timeOutKeyC), m_settings.timeOutS);
|
||||||
settings->setValue(QLatin1String(promptToSubmitKeyC), m_settings.promptToSubmit);
|
settings->setValue(QLatin1String(promptToSubmitKeyC), m_settings.promptToSubmit);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
@@ -58,6 +58,7 @@ struct Settings {
|
|||||||
QString p4User;
|
QString p4User;
|
||||||
QString errorString;
|
QString errorString;
|
||||||
bool defaultEnv;
|
bool defaultEnv;
|
||||||
|
int timeOutS;
|
||||||
bool promptToSubmit;
|
bool promptToSubmit;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -92,6 +93,10 @@ public:
|
|||||||
void setSettings(const Settings &s);
|
void setSettings(const Settings &s);
|
||||||
Settings settings() const;
|
Settings settings() const;
|
||||||
|
|
||||||
|
inline int timeOutS() const { return m_settings.timeOutS; }
|
||||||
|
inline int timeOutMS() const { return m_settings.timeOutS * 10000; }
|
||||||
|
inline int longTimeOutMS() const { return m_settings.timeOutS * 100000; }
|
||||||
|
|
||||||
QString topLevel() const;
|
QString topLevel() const;
|
||||||
QString topLevelSymLinkTarget() const;
|
QString topLevelSymLinkTarget() const;
|
||||||
|
|
||||||
|
@@ -81,6 +81,7 @@ Settings SettingsPageWidget::settings() const
|
|||||||
settings.p4Port = m_ui.portLineEdit->text();
|
settings.p4Port = m_ui.portLineEdit->text();
|
||||||
settings.p4User = m_ui.userLineEdit->text();
|
settings.p4User = m_ui.userLineEdit->text();
|
||||||
settings.p4Client= m_ui.clientLineEdit->text();
|
settings.p4Client= m_ui.clientLineEdit->text();
|
||||||
|
settings.timeOutS = m_ui.timeOutSpinBox->value();
|
||||||
settings.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
settings.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
@@ -92,6 +93,7 @@ void SettingsPageWidget::setSettings(const PerforceSettings &s)
|
|||||||
m_ui.portLineEdit->setText(s.p4Port());
|
m_ui.portLineEdit->setText(s.p4Port());
|
||||||
m_ui.clientLineEdit->setText(s.p4Client());
|
m_ui.clientLineEdit->setText(s.p4Client());
|
||||||
m_ui.userLineEdit->setText(s.p4User());
|
m_ui.userLineEdit->setText(s.p4User());
|
||||||
|
m_ui.timeOutSpinBox->setValue(s.timeOutS());
|
||||||
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit());
|
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,14 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Perforce::Internal::SettingsPage</class>
|
<class>Perforce::Internal::SettingsPage</class>
|
||||||
<widget class="QWidget" name="Perforce::Internal::SettingsPage">
|
<widget class="QWidget" name="Perforce::Internal::SettingsPage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>437</width>
|
||||||
|
<height>407</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="configGroupBox">
|
<widget class="QGroupBox" name="configGroupBox">
|
||||||
@@ -82,13 +90,33 @@
|
|||||||
<string>Miscellaneous</string>
|
<string>Miscellaneous</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout_2">
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prompt on submit</string>
|
<string>Prompt on submit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="timeOutLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Timeout:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="timeOutSpinBox">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>360</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@@ -58,6 +58,7 @@ SubversionSettings SettingsPageWidget::settings() const
|
|||||||
rc.useAuthentication = m_ui.userGroupBox->isChecked();
|
rc.useAuthentication = m_ui.userGroupBox->isChecked();
|
||||||
rc.user = m_ui.usernameLineEdit->text();
|
rc.user = m_ui.usernameLineEdit->text();
|
||||||
rc.password = m_ui.passwordLineEdit->text();
|
rc.password = m_ui.passwordLineEdit->text();
|
||||||
|
rc.timeOutS = m_ui.timeOutSpinBox->value();
|
||||||
if (rc.user.isEmpty())
|
if (rc.user.isEmpty())
|
||||||
rc.useAuthentication = false;
|
rc.useAuthentication = false;
|
||||||
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
||||||
@@ -70,6 +71,7 @@ void SettingsPageWidget::setSettings(const SubversionSettings &s)
|
|||||||
m_ui.usernameLineEdit->setText(s.user);
|
m_ui.usernameLineEdit->setText(s.user);
|
||||||
m_ui.passwordLineEdit->setText(s.password);
|
m_ui.passwordLineEdit->setText(s.password);
|
||||||
m_ui.userGroupBox->setChecked(s.useAuthentication);
|
m_ui.userGroupBox->setChecked(s.useAuthentication);
|
||||||
|
m_ui.timeOutSpinBox->setValue(s.timeOutS);
|
||||||
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
|
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>473</width>
|
<width>496</width>
|
||||||
<height>295</height>
|
<height>295</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -72,13 +72,33 @@
|
|||||||
<string>Miscellaneous</string>
|
<string>Miscellaneous</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout_2">
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prompt on submit</string>
|
<string>Prompt on submit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="timeOutLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Timeout:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="timeOutSpinBox">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>360</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@@ -71,11 +71,6 @@
|
|||||||
|
|
||||||
using namespace Subversion::Internal;
|
using namespace Subversion::Internal;
|
||||||
|
|
||||||
// Timeout for normal output commands
|
|
||||||
enum { subversionShortTimeOut = 10000 };
|
|
||||||
// Timeout for submit, update
|
|
||||||
enum { subversionLongTimeOut = 120000 };
|
|
||||||
|
|
||||||
static const char * const CMD_ID_SUBVERSION_MENU = "Subversion.Menu";
|
static const char * const CMD_ID_SUBVERSION_MENU = "Subversion.Menu";
|
||||||
static const char * const CMD_ID_ADD = "Subversion.Add";
|
static const char * const CMD_ID_ADD = "Subversion.Add";
|
||||||
static const char * const CMD_ID_DELETE_FILE = "Subversion.Delete";
|
static const char * const CMD_ID_DELETE_FILE = "Subversion.Delete";
|
||||||
@@ -470,7 +465,7 @@ void SubversionPlugin::svnDiff(const QString &workingDir, const QStringList &fil
|
|||||||
QStringList args(QLatin1String("diff"));
|
QStringList args(QLatin1String("diff"));
|
||||||
args << files;
|
args << files;
|
||||||
|
|
||||||
const SubversionResponse response = runSvn(workingDir, args, subversionShortTimeOut, false, codec);
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeOutMS(), false, codec);
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -551,7 +546,7 @@ void SubversionPlugin::revertCurrentFile()
|
|||||||
QStringList args(QLatin1String("diff"));
|
QStringList args(QLatin1String("diff"));
|
||||||
args.push_back(state.relativeCurrentFile());
|
args.push_back(state.relativeCurrentFile());
|
||||||
|
|
||||||
const SubversionResponse diffResponse = runSvn(state.currentFileTopLevel(), args, subversionShortTimeOut, false);
|
const SubversionResponse diffResponse = runSvn(state.currentFileTopLevel(), args, m_settings.timeOutMS(), false);
|
||||||
if (diffResponse.error)
|
if (diffResponse.error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -568,7 +563,7 @@ void SubversionPlugin::revertCurrentFile()
|
|||||||
args.clear();
|
args.clear();
|
||||||
args << QLatin1String("revert") << state.relativeCurrentFile();
|
args << QLatin1String("revert") << state.relativeCurrentFile();
|
||||||
|
|
||||||
const SubversionResponse revertResponse = runSvn(state.currentFileTopLevel(), args, subversionShortTimeOut, true);
|
const SubversionResponse revertResponse = runSvn(state.currentFileTopLevel(), args, m_settings.timeOutMS(), true);
|
||||||
if (!revertResponse.error) {
|
if (!revertResponse.error) {
|
||||||
fcb.setModifiedReload(true);
|
fcb.setModifiedReload(true);
|
||||||
subVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
|
subVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
|
||||||
@@ -618,7 +613,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList
|
|||||||
QStringList args(QLatin1String("status"));
|
QStringList args(QLatin1String("status"));
|
||||||
args += files;
|
args += files;
|
||||||
|
|
||||||
const SubversionResponse response = runSvn(workingDir, args, subversionShortTimeOut, false);
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeOutMS(), false);
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -659,7 +654,7 @@ bool SubversionPlugin::commit(const QString &messageFile,
|
|||||||
QStringList args = QStringList(QLatin1String("commit"));
|
QStringList args = QStringList(QLatin1String("commit"));
|
||||||
args << QLatin1String(nonInteractiveOptionC) << QLatin1String("--file") << messageFile;
|
args << QLatin1String(nonInteractiveOptionC) << QLatin1String("--file") << messageFile;
|
||||||
args.append(subVersionFileList);
|
args.append(subVersionFileList);
|
||||||
const SubversionResponse response = runSvn(m_commitRepository, args, subversionLongTimeOut, true);
|
const SubversionResponse response = runSvn(m_commitRepository, args, m_settings.longTimeOutMS(), true);
|
||||||
return !response.error ;
|
return !response.error ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -678,7 +673,7 @@ void SubversionPlugin::filelog(const QString &workingDir, const QStringList &fil
|
|||||||
foreach(const QString &file, files)
|
foreach(const QString &file, files)
|
||||||
args.append(QDir::toNativeSeparators(file));
|
args.append(QDir::toNativeSeparators(file));
|
||||||
|
|
||||||
const SubversionResponse response = runSvn(workingDir, args, subversionShortTimeOut, false, codec);
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeOutMS(), false, codec);
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -705,7 +700,7 @@ void SubversionPlugin::updateProject()
|
|||||||
QStringList args(QLatin1String("update"));
|
QStringList args(QLatin1String("update"));
|
||||||
args.push_back(QLatin1String(nonInteractiveOptionC));
|
args.push_back(QLatin1String(nonInteractiveOptionC));
|
||||||
args.append(state.relativeCurrentProject());
|
args.append(state.relativeCurrentProject());
|
||||||
const SubversionResponse response = runSvn(state.currentProjectTopLevel(), args, subversionLongTimeOut, true);
|
const SubversionResponse response = runSvn(state.currentProjectTopLevel(), args, m_settings.longTimeOutMS(), true);
|
||||||
if (!response.error)
|
if (!response.error)
|
||||||
subVersionControl()->emitRepositoryChanged(state.currentProjectTopLevel());
|
subVersionControl()->emitRepositoryChanged(state.currentProjectTopLevel());
|
||||||
}
|
}
|
||||||
@@ -725,7 +720,7 @@ void SubversionPlugin::annotate(const QString &workingDir, const QString &file)
|
|||||||
args.push_back(QLatin1String("-v"));
|
args.push_back(QLatin1String("-v"));
|
||||||
args.append(QDir::toNativeSeparators(file));
|
args.append(QDir::toNativeSeparators(file));
|
||||||
|
|
||||||
const SubversionResponse response = runSvn(workingDir, args, subversionShortTimeOut, false, codec);
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeOutMS(), false, codec);
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -753,7 +748,7 @@ void SubversionPlugin::projectStatus()
|
|||||||
QTC_ASSERT(state.hasProject(), return);
|
QTC_ASSERT(state.hasProject(), return);
|
||||||
QStringList args(QLatin1String("status"));
|
QStringList args(QLatin1String("status"));
|
||||||
args += state.relativeCurrentProject();
|
args += state.relativeCurrentProject();
|
||||||
runSvn(state.currentProjectTopLevel(), args, subversionShortTimeOut, true);
|
runSvn(state.currentProjectTopLevel(), args, m_settings.timeOutMS(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubversionPlugin::describe(const QString &source, const QString &changeNr)
|
void SubversionPlugin::describe(const QString &source, const QString &changeNr)
|
||||||
@@ -776,7 +771,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
|
|||||||
QStringList args(QLatin1String("log"));
|
QStringList args(QLatin1String("log"));
|
||||||
args.push_back(QLatin1String("-r"));
|
args.push_back(QLatin1String("-r"));
|
||||||
args.push_back(changeNr);
|
args.push_back(changeNr);
|
||||||
const SubversionResponse logResponse = runSvn(topLevel, args, subversionShortTimeOut, false);
|
const SubversionResponse logResponse = runSvn(topLevel, args, m_settings.timeOutMS(), false);
|
||||||
if (logResponse.error)
|
if (logResponse.error)
|
||||||
return;
|
return;
|
||||||
description = logResponse.stdOut;
|
description = logResponse.stdOut;
|
||||||
@@ -790,7 +785,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
|
|||||||
args.push_back(diffArg);
|
args.push_back(diffArg);
|
||||||
|
|
||||||
QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(source);
|
QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(source);
|
||||||
const SubversionResponse response = runSvn(topLevel, args, subversionShortTimeOut, false, codec);
|
const SubversionResponse response = runSvn(topLevel, args, m_settings.timeOutMS(), false, codec);
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
description += response.stdOut;
|
description += response.stdOut;
|
||||||
@@ -963,7 +958,7 @@ bool SubversionPlugin::vcsAdd(const QString &workingDir, const QString &rawFileN
|
|||||||
QStringList args(QLatin1String("add"));
|
QStringList args(QLatin1String("add"));
|
||||||
args.push_back(file);
|
args.push_back(file);
|
||||||
|
|
||||||
const SubversionResponse response = runSvn(workingDir, args, subversionShortTimeOut, true);
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeOutMS(), true);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,7 +969,7 @@ bool SubversionPlugin::vcsDelete(const QString &workingDir, const QString &rawFi
|
|||||||
QStringList args(QLatin1String("delete"));
|
QStringList args(QLatin1String("delete"));
|
||||||
args.push_back(file);
|
args.push_back(file);
|
||||||
|
|
||||||
const SubversionResponse response = runSvn(workingDir, args, subversionShortTimeOut, true);
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeOutMS(), true);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,6 +41,9 @@ static const char *authenticationKeyC = "Authentication";
|
|||||||
static const char *userNameOptionC = "--username";
|
static const char *userNameOptionC = "--username";
|
||||||
static const char *passwordOptionC = "--password";
|
static const char *passwordOptionC = "--password";
|
||||||
static const char *promptToSubmitKeyC = "PromptForSubmit";
|
static const char *promptToSubmitKeyC = "PromptForSubmit";
|
||||||
|
static const char *timeOutKeyC = "TimeOut";
|
||||||
|
|
||||||
|
enum { defaultTimeOutS = 30 };
|
||||||
|
|
||||||
static QString defaultCommand()
|
static QString defaultCommand()
|
||||||
{
|
{
|
||||||
@@ -57,6 +60,7 @@ using namespace Subversion::Internal;
|
|||||||
SubversionSettings::SubversionSettings() :
|
SubversionSettings::SubversionSettings() :
|
||||||
svnCommand(defaultCommand()),
|
svnCommand(defaultCommand()),
|
||||||
useAuthentication(false),
|
useAuthentication(false),
|
||||||
|
timeOutS(defaultTimeOutS),
|
||||||
promptToSubmit(true)
|
promptToSubmit(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -68,6 +72,7 @@ void SubversionSettings::fromSettings(QSettings *settings)
|
|||||||
useAuthentication = settings->value(QLatin1String(authenticationKeyC), QVariant(false)).toBool();
|
useAuthentication = settings->value(QLatin1String(authenticationKeyC), QVariant(false)).toBool();
|
||||||
user = settings->value(QLatin1String(userKeyC), QString()).toString();
|
user = settings->value(QLatin1String(userKeyC), QString()).toString();
|
||||||
password = settings->value(QLatin1String(passwordKeyC), QString()).toString();
|
password = settings->value(QLatin1String(passwordKeyC), QString()).toString();
|
||||||
|
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
||||||
promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
|
promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
@@ -80,6 +85,7 @@ void SubversionSettings::toSettings(QSettings *settings) const
|
|||||||
settings->setValue(QLatin1String(userKeyC), user);
|
settings->setValue(QLatin1String(userKeyC), user);
|
||||||
settings->setValue(QLatin1String(passwordKeyC), password);
|
settings->setValue(QLatin1String(passwordKeyC), password);
|
||||||
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
|
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
|
||||||
|
settings->setValue(QLatin1String(timeOutKeyC), timeOutS);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,6 +95,7 @@ bool SubversionSettings::equals(const SubversionSettings &s) const
|
|||||||
&& useAuthentication == s.useAuthentication
|
&& useAuthentication == s.useAuthentication
|
||||||
&& user == s.user
|
&& user == s.user
|
||||||
&& password == s.password
|
&& password == s.password
|
||||||
|
&& timeOutS == s.timeOutS
|
||||||
&& promptToSubmit == s.promptToSubmit;
|
&& promptToSubmit == s.promptToSubmit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,6 +47,9 @@ struct SubversionSettings
|
|||||||
void fromSettings(QSettings *);
|
void fromSettings(QSettings *);
|
||||||
void toSettings(QSettings *) const;
|
void toSettings(QSettings *) const;
|
||||||
|
|
||||||
|
inline int timeOutMS() const { return timeOutS * 10000; }
|
||||||
|
inline int longTimeOutMS() const { return timeOutS * 100000; }
|
||||||
|
|
||||||
// Add authentication and (maybe future) options to the
|
// Add authentication and (maybe future) options to the
|
||||||
// command line
|
// command line
|
||||||
QStringList addOptions(const QStringList &args) const;
|
QStringList addOptions(const QStringList &args) const;
|
||||||
@@ -59,6 +62,7 @@ struct SubversionSettings
|
|||||||
bool useAuthentication;
|
bool useAuthentication;
|
||||||
QString user;
|
QString user;
|
||||||
QString password;
|
QString password;
|
||||||
|
int timeOutS;
|
||||||
bool promptToSubmit;
|
bool promptToSubmit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user