forked from qt-creator/qt-creator
SubversionPlugin: Introduce convenient s_defaultFlags
Change-Id: Ic8b91eea66703541bab73218ac738c4b9cc250d2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -108,6 +108,8 @@ const char CMD_ID_UPDATE[] = "Subversion.Update";
|
|||||||
const char CMD_ID_COMMIT_PROJECT[] = "Subversion.CommitProject";
|
const char CMD_ID_COMMIT_PROJECT[] = "Subversion.CommitProject";
|
||||||
const char CMD_ID_DESCRIBE[] = "Subversion.Describe";
|
const char CMD_ID_DESCRIBE[] = "Subversion.Describe";
|
||||||
|
|
||||||
|
const int s_defaultFlags = ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut;
|
||||||
|
|
||||||
struct SubversionResponse
|
struct SubversionResponse
|
||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
@@ -692,9 +694,8 @@ void SubversionPluginPrivate::revertAll()
|
|||||||
args << QLatin1String("revert");
|
args << QLatin1String("revert");
|
||||||
args << SubversionClient::addAuthenticationOptions(m_settings);
|
args << SubversionClient::addAuthenticationOptions(m_settings);
|
||||||
args << QLatin1String("--recursive") << state.topLevel().toString();
|
args << QLatin1String("--recursive") << state.topLevel().toString();
|
||||||
const SubversionResponse revertResponse
|
const auto revertResponse = runSvn(state.topLevel(), args, m_settings.timeout.value(),
|
||||||
= runSvn(state.topLevel(), args, m_settings.timeout.value(),
|
s_defaultFlags);
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut);
|
|
||||||
if (revertResponse.error)
|
if (revertResponse.error)
|
||||||
QMessageBox::warning(ICore::dialogParent(), title,
|
QMessageBox::warning(ICore::dialogParent(), title,
|
||||||
tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
|
tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
|
||||||
@@ -732,9 +733,8 @@ void SubversionPluginPrivate::revertCurrentFile()
|
|||||||
args << SubversionClient::addAuthenticationOptions(m_settings);
|
args << SubversionClient::addAuthenticationOptions(m_settings);
|
||||||
args << SubversionClient::escapeFile(state.relativeCurrentFile());
|
args << SubversionClient::escapeFile(state.relativeCurrentFile());
|
||||||
|
|
||||||
const SubversionResponse revertResponse
|
const auto revertResponse = runSvn(state.currentFileTopLevel(), args,
|
||||||
= runSvn(state.currentFileTopLevel(), args, m_settings.timeout.value(),
|
m_settings.timeout.value(), s_defaultFlags);
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut);
|
|
||||||
|
|
||||||
if (!revertResponse.error)
|
if (!revertResponse.error)
|
||||||
emit filesChanged(QStringList(state.currentFile()));
|
emit filesChanged(QStringList(state.currentFile()));
|
||||||
@@ -905,9 +905,7 @@ void SubversionPluginPrivate::svnUpdate(const FilePath &workingDir, const QStrin
|
|||||||
args.push_back(QLatin1String(Constants::NON_INTERACTIVE_OPTION));
|
args.push_back(QLatin1String(Constants::NON_INTERACTIVE_OPTION));
|
||||||
if (!relativePath.isEmpty())
|
if (!relativePath.isEmpty())
|
||||||
args.append(relativePath);
|
args.append(relativePath);
|
||||||
const SubversionResponse response
|
const auto response = runSvn(workingDir, args, 10 * m_settings.timeout.value(), s_defaultFlags);
|
||||||
= runSvn(workingDir, args, 10 * m_settings.timeout.value(),
|
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut);
|
|
||||||
if (!response.error)
|
if (!response.error)
|
||||||
emit repositoryChanged(workingDir);
|
emit repositoryChanged(workingDir);
|
||||||
}
|
}
|
||||||
@@ -935,8 +933,7 @@ void SubversionPluginPrivate::vcsAnnotateHelper(const FilePath &workingDir, cons
|
|||||||
args.push_back(QLatin1String("-v"));
|
args.push_back(QLatin1String("-v"));
|
||||||
args.append(QDir::toNativeSeparators(SubversionClient::escapeFile(file)));
|
args.append(QDir::toNativeSeparators(SubversionClient::escapeFile(file)));
|
||||||
|
|
||||||
const SubversionResponse response
|
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeout.value(),
|
||||||
= runSvn(workingDir, args, m_settings.timeout.value(),
|
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ForceCLocale, codec);
|
ShellCommand::SshPasswordPrompt | ShellCommand::ForceCLocale, codec);
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
@@ -1094,9 +1091,7 @@ bool SubversionPluginPrivate::vcsAdd(const FilePath &workingDir, const QString &
|
|||||||
args << QLatin1String("add")
|
args << QLatin1String("add")
|
||||||
<< SubversionClient::addAuthenticationOptions(m_settings)
|
<< SubversionClient::addAuthenticationOptions(m_settings)
|
||||||
<< QLatin1String("--parents") << file;
|
<< QLatin1String("--parents") << file;
|
||||||
const SubversionResponse response
|
const auto response = runSvn(workingDir, args, m_settings.timeout.value(), s_defaultFlags);
|
||||||
= runSvn(workingDir, args, m_settings.timeout.value(),
|
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut);
|
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1109,9 +1104,7 @@ bool SubversionPluginPrivate::vcsDelete(const FilePath &workingDir, const QStrin
|
|||||||
args << SubversionClient::addAuthenticationOptions(m_settings)
|
args << SubversionClient::addAuthenticationOptions(m_settings)
|
||||||
<< QLatin1String("--force") << file;
|
<< QLatin1String("--force") << file;
|
||||||
|
|
||||||
const SubversionResponse response
|
const auto response = runSvn(workingDir, args, m_settings.timeout.value(), s_defaultFlags);
|
||||||
= runSvn(workingDir, args, m_settings.timeout.value(),
|
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut);
|
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1121,9 +1114,8 @@ bool SubversionPluginPrivate::vcsMove(const FilePath &workingDir, const QString
|
|||||||
args << SubversionClient::addAuthenticationOptions(m_settings);
|
args << SubversionClient::addAuthenticationOptions(m_settings);
|
||||||
args << QDir::toNativeSeparators(SubversionClient::escapeFile(from))
|
args << QDir::toNativeSeparators(SubversionClient::escapeFile(from))
|
||||||
<< QDir::toNativeSeparators(SubversionClient::escapeFile(to));
|
<< QDir::toNativeSeparators(SubversionClient::escapeFile(to));
|
||||||
const SubversionResponse response = runSvn(workingDir, args, m_settings.timeout.value(),
|
const auto response = runSvn(workingDir, args, m_settings.timeout.value(),
|
||||||
ShellCommand::SshPasswordPrompt | ShellCommand::ShowStdOut
|
s_defaultFlags | ShellCommand::FullySynchronously);
|
||||||
| ShellCommand::FullySynchronously);
|
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user