forked from qt-creator/qt-creator
VcsCommand: Remove unused SshPasswordPrompt
Change-Id: I402d619656d8339b1e81bc9ae96acf56178505d2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -113,8 +113,6 @@ const char CVS_SUBMIT_MIMETYPE[] = "text/vnd.qtcreator.cvs.submit";
|
|||||||
const char CVSCOMMITEDITOR_ID[] = "CVS Commit Editor";
|
const char CVSCOMMITEDITOR_ID[] = "CVS Commit Editor";
|
||||||
const char CVSCOMMITEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "CVS Commit Editor");
|
const char CVSCOMMITEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "CVS Commit Editor");
|
||||||
|
|
||||||
const int s_defaultFlags = VcsCommand::SshPasswordPrompt | VcsCommand::ShowStdOut;
|
|
||||||
|
|
||||||
class CvsResponse
|
class CvsResponse
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -310,7 +308,7 @@ private:
|
|||||||
CvsResponse runCvs(const FilePath &workingDirectory,
|
CvsResponse runCvs(const FilePath &workingDirectory,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
int timeOutS,
|
int timeOutS,
|
||||||
unsigned flags,
|
unsigned flags = 0,
|
||||||
QTextCodec *outputCodec = nullptr) const;
|
QTextCodec *outputCodec = nullptr) const;
|
||||||
|
|
||||||
void annotate(const FilePath &workingDir, const QString &file,
|
void annotate(const FilePath &workingDir, const QString &file,
|
||||||
@@ -873,7 +871,7 @@ void CvsPluginPrivate::revertAll()
|
|||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("update") << QLatin1String("-C") << state.topLevel().toString();
|
args << QLatin1String("update") << QLatin1String("-C") << state.topLevel().toString();
|
||||||
const auto revertResponse = runCvs(state.topLevel(), args, m_settings.timeout.value(),
|
const auto revertResponse = runCvs(state.topLevel(), args, m_settings.timeout.value(),
|
||||||
s_defaultFlags);
|
VcsCommand::ShowStdOut);
|
||||||
if (revertResponse.result == CvsResponse::Ok)
|
if (revertResponse.result == CvsResponse::Ok)
|
||||||
emit repositoryChanged(state.topLevel());
|
emit repositoryChanged(state.topLevel());
|
||||||
else
|
else
|
||||||
@@ -910,7 +908,7 @@ void CvsPluginPrivate::revertCurrentFile()
|
|||||||
args.clear();
|
args.clear();
|
||||||
args << QLatin1String("update") << QLatin1String("-C") << state.relativeCurrentFile();
|
args << QLatin1String("update") << QLatin1String("-C") << state.relativeCurrentFile();
|
||||||
const auto revertResponse = runCvs(state.currentFileTopLevel(), args,
|
const auto revertResponse = runCvs(state.currentFileTopLevel(), args,
|
||||||
m_settings.timeout.value(), s_defaultFlags);
|
m_settings.timeout.value(), VcsCommand::ShowStdOut);
|
||||||
if (revertResponse.result == CvsResponse::Ok)
|
if (revertResponse.result == CvsResponse::Ok)
|
||||||
emit filesChanged(QStringList(state.currentFile()));
|
emit filesChanged(QStringList(state.currentFile()));
|
||||||
}
|
}
|
||||||
@@ -1020,7 +1018,7 @@ bool CvsPluginPrivate::commit(const QString &messageFile,
|
|||||||
args << QLatin1String("-F") << messageFile;
|
args << QLatin1String("-F") << messageFile;
|
||||||
args.append(fileList);
|
args.append(fileList);
|
||||||
const auto response = runCvs(m_commitRepository, args, 10 * m_settings.timeout.value(),
|
const auto response = runCvs(m_commitRepository, args, 10 * m_settings.timeout.value(),
|
||||||
s_defaultFlags);
|
VcsCommand::ShowStdOut);
|
||||||
return response.result == CvsResponse::Ok ;
|
return response.result == CvsResponse::Ok ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,8 +1055,7 @@ void CvsPluginPrivate::filelog(const FilePath &workingDir,
|
|||||||
args << QLatin1String("log");
|
args << QLatin1String("log");
|
||||||
args.append(file);
|
args.append(file);
|
||||||
const CvsResponse response =
|
const CvsResponse response =
|
||||||
runCvs(workingDir, args, m_settings.timeout.value(),
|
runCvs(workingDir, args, m_settings.timeout.value(), 0, codec);
|
||||||
VcsCommand::SshPasswordPrompt, codec);
|
|
||||||
if (response.result != CvsResponse::Ok)
|
if (response.result != CvsResponse::Ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1097,7 +1094,7 @@ bool CvsPluginPrivate::update(const FilePath &topLevel, const QString &file)
|
|||||||
args.push_back(QLatin1String("-dR"));
|
args.push_back(QLatin1String("-dR"));
|
||||||
if (!file.isEmpty())
|
if (!file.isEmpty())
|
||||||
args.append(file);
|
args.append(file);
|
||||||
const auto response = runCvs(topLevel, args, 10 * m_settings.timeout.value(), s_defaultFlags);
|
const auto response = runCvs(topLevel, args, 10 * m_settings.timeout.value(), VcsCommand::ShowStdOut);
|
||||||
const bool ok = response.result == CvsResponse::Ok;
|
const bool ok = response.result == CvsResponse::Ok;
|
||||||
if (ok)
|
if (ok)
|
||||||
emit repositoryChanged(topLevel);
|
emit repositoryChanged(topLevel);
|
||||||
@@ -1142,7 +1139,7 @@ bool CvsPluginPrivate::edit(const FilePath &topLevel, const QStringList &files)
|
|||||||
{
|
{
|
||||||
QStringList args(QLatin1String("edit"));
|
QStringList args(QLatin1String("edit"));
|
||||||
args.append(files);
|
args.append(files);
|
||||||
const auto response = runCvs(topLevel, args, m_settings.timeout.value(), s_defaultFlags);
|
const auto response = runCvs(topLevel, args, m_settings.timeout.value(), VcsCommand::ShowStdOut);
|
||||||
return response.result == CvsResponse::Ok;
|
return response.result == CvsResponse::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1180,7 +1177,7 @@ bool CvsPluginPrivate::unedit(const FilePath &topLevel, const QStringList &files
|
|||||||
if (modified)
|
if (modified)
|
||||||
args.append(QLatin1String("-y"));
|
args.append(QLatin1String("-y"));
|
||||||
args.append(files);
|
args.append(files);
|
||||||
const auto response = runCvs(topLevel, args, m_settings.timeout.value(), s_defaultFlags);
|
const auto response = runCvs(topLevel, args, m_settings.timeout.value(), VcsCommand::ShowStdOut);
|
||||||
return response.result == CvsResponse::Ok;
|
return response.result == CvsResponse::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1197,8 +1194,7 @@ void CvsPluginPrivate::annotate(const FilePath &workingDir, const QString &file,
|
|||||||
if (!revision.isEmpty())
|
if (!revision.isEmpty())
|
||||||
args << QLatin1String("-r") << revision;
|
args << QLatin1String("-r") << revision;
|
||||||
args << file;
|
args << file;
|
||||||
const CvsResponse response = runCvs(workingDir, args, m_settings.timeout.value(),
|
const CvsResponse response = runCvs(workingDir, args, m_settings.timeout.value(), 0, codec);
|
||||||
VcsCommand::SshPasswordPrompt, codec);
|
|
||||||
if (response.result != CvsResponse::Ok)
|
if (response.result != CvsResponse::Ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1299,8 +1295,7 @@ bool CvsPluginPrivate::describe(const FilePath &toplevel, const QString &file, c
|
|||||||
// 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, m_settings.timeout.value(),
|
const CvsResponse logResponse = runCvs(toplevel, args, m_settings.timeout.value());
|
||||||
VcsCommand::SshPasswordPrompt);
|
|
||||||
if (logResponse.result != CvsResponse::Ok) {
|
if (logResponse.result != CvsResponse::Ok) {
|
||||||
*errorMessage = logResponse.message;
|
*errorMessage = logResponse.message;
|
||||||
return false;
|
return false;
|
||||||
@@ -1321,8 +1316,7 @@ bool CvsPluginPrivate::describe(const FilePath &toplevel, const QString &file, c
|
|||||||
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, 10 * m_settings.timeout.value(),
|
const CvsResponse repoLogResponse = runCvs(toplevel, args, 10 * m_settings.timeout.value());
|
||||||
VcsCommand::SshPasswordPrompt);
|
|
||||||
if (repoLogResponse.result != CvsResponse::Ok) {
|
if (repoLogResponse.result != CvsResponse::Ok) {
|
||||||
*errorMessage = repoLogResponse.message;
|
*errorMessage = repoLogResponse.message;
|
||||||
return false;
|
return false;
|
||||||
@@ -1358,8 +1352,7 @@ bool CvsPluginPrivate::describe(const FilePath &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, m_settings.timeout.value(),
|
const CvsResponse logResponse = runCvs(repositoryPath, args, m_settings.timeout.value());
|
||||||
VcsCommand::SshPasswordPrompt);
|
|
||||||
if (logResponse.result != CvsResponse::Ok) {
|
if (logResponse.result != CvsResponse::Ok) {
|
||||||
*errorMessage = logResponse.message;
|
*errorMessage = logResponse.message;
|
||||||
return false;
|
return false;
|
||||||
@@ -1487,7 +1480,7 @@ bool CvsPluginPrivate::vcsAdd(const FilePath &workingDir, const QString &rawFile
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("add") << rawFileName;
|
args << QLatin1String("add") << rawFileName;
|
||||||
const auto response = runCvs(workingDir, args, m_settings.timeout.value(), s_defaultFlags);
|
const auto response = runCvs(workingDir, args, m_settings.timeout.value(), VcsCommand::ShowStdOut);
|
||||||
return response.result == CvsResponse::Ok;
|
return response.result == CvsResponse::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1495,7 +1488,7 @@ bool CvsPluginPrivate::vcsDelete(const FilePath &workingDir, const QString &rawF
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("remove") << QLatin1String("-f") << rawFileName;
|
args << QLatin1String("remove") << QLatin1String("-f") << rawFileName;
|
||||||
const auto response = runCvs(workingDir, args, m_settings.timeout.value(), s_defaultFlags);
|
const auto response = runCvs(workingDir, args, m_settings.timeout.value(), VcsCommand::ShowStdOut);
|
||||||
return response.result == CvsResponse::Ok;
|
return response.result == CvsResponse::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1535,7 +1528,7 @@ bool CvsPluginPrivate::managesFile(const FilePath &workingDirectory, const QStri
|
|||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("status") << fileName;
|
args << QLatin1String("status") << fileName;
|
||||||
const CvsResponse response =
|
const CvsResponse response =
|
||||||
runCvs(workingDirectory, args, m_settings.timeout.value(), VcsCommand::SshPasswordPrompt);
|
runCvs(workingDirectory, args, m_settings.timeout.value());
|
||||||
if (response.result != CvsResponse::Ok)
|
if (response.result != CvsResponse::Ok)
|
||||||
return false;
|
return false;
|
||||||
return !response.stdOut.contains(QLatin1String("Status: Unknown"));
|
return !response.stdOut.contains(QLatin1String("Status: Unknown"));
|
||||||
|
@@ -2500,11 +2500,9 @@ void GitClient::continuePreviousGitCommand(const FilePath &workingDirectory,
|
|||||||
QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryURL,
|
QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryURL,
|
||||||
const FilePath &workingDirectory) const
|
const FilePath &workingDirectory) const
|
||||||
{
|
{
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
|
||||||
| VcsCommand::SuppressStdErr
|
|
||||||
| VcsCommand::SuppressFailMessage;
|
|
||||||
const CommandResult result = vcsSynchronousExec(workingDirectory,
|
const CommandResult result = vcsSynchronousExec(workingDirectory,
|
||||||
{"ls-remote", repositoryURL, HEAD, "refs/heads/*"}, flags);
|
{"ls-remote", repositoryURL, HEAD, "refs/heads/*"},
|
||||||
|
VcsCommand::SuppressStdErr | VcsCommand::SuppressFailMessage);
|
||||||
QStringList branches;
|
QStringList branches;
|
||||||
branches << tr("<Detached HEAD>");
|
branches << tr("<Detached HEAD>");
|
||||||
QString headSha;
|
QString headSha;
|
||||||
@@ -3121,9 +3119,7 @@ bool GitClient::executeAndHandleConflicts(const FilePath &workingDirectory,
|
|||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
const QString &abortCommand) const
|
const QString &abortCommand) const
|
||||||
{
|
{
|
||||||
// Disable UNIX terminals to suppress SSH prompting.
|
const unsigned flags = VcsCommand::ShowStdOut
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ExpectRepoChanges
|
| VcsCommand::ExpectRepoChanges
|
||||||
| VcsCommand::ShowSuccessMessage;
|
| VcsCommand::ShowSuccessMessage;
|
||||||
const CommandResult result = vcsSynchronousExec(workingDirectory, arguments, flags);
|
const CommandResult result = vcsSynchronousExec(workingDirectory, arguments, flags);
|
||||||
@@ -3254,11 +3250,8 @@ void GitClient::addFuture(const QFuture<void> &future)
|
|||||||
// Subversion: git svn
|
// Subversion: git svn
|
||||||
void GitClient::synchronousSubversionFetch(const FilePath &workingDirectory) const
|
void GitClient::synchronousSubversionFetch(const FilePath &workingDirectory) const
|
||||||
{
|
{
|
||||||
// Disable UNIX terminals to suppress SSH prompting.
|
vcsSynchronousExec(workingDirectory, {"svn", "fetch"},
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage);
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ShowSuccessMessage;
|
|
||||||
vcsSynchronousExec(workingDirectory, {"svn", "fetch"}, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::subversionLog(const FilePath &workingDirectory) const
|
void GitClient::subversionLog(const FilePath &workingDirectory) const
|
||||||
@@ -3427,9 +3420,7 @@ VcsCommand *GitClient::vcsExecAbortable(const FilePath &workingDirectory,
|
|||||||
if (abortCommand.isEmpty())
|
if (abortCommand.isEmpty())
|
||||||
abortCommand = arguments.at(0);
|
abortCommand = arguments.at(0);
|
||||||
VcsCommand *command = createCommand(workingDirectory, nullptr, VcsWindowOutputBind);
|
VcsCommand *command = createCommand(workingDirectory, nullptr, VcsWindowOutputBind);
|
||||||
command->addFlags(VcsCommand::SshPasswordPrompt
|
command->addFlags(VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage);
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ShowSuccessMessage);
|
|
||||||
// For rebase, Git might request an editor (which means the process keeps running until the
|
// For rebase, Git might request an editor (which means the process keeps running until the
|
||||||
// user closes it), so run without timeout.
|
// user closes it), so run without timeout.
|
||||||
command->addJob({vcsBinary(), arguments}, isRebase ? 0 : vcsTimeoutS());
|
command->addJob({vcsBinary(), arguments}, isRebase ? 0 : vcsTimeoutS());
|
||||||
|
@@ -118,9 +118,7 @@ bool MercurialClient::synchronousClone(const FilePath &workingDirectory,
|
|||||||
{
|
{
|
||||||
Q_UNUSED(srcLocation)
|
Q_UNUSED(srcLocation)
|
||||||
Q_UNUSED(extraOptions)
|
Q_UNUSED(extraOptions)
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
const unsigned flags = VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage;
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ShowSuccessMessage;
|
|
||||||
|
|
||||||
if (workingDirectory.exists()) {
|
if (workingDirectory.exists()) {
|
||||||
// Let's make first init
|
// Let's make first init
|
||||||
@@ -164,17 +162,13 @@ bool MercurialClient::synchronousPull(const FilePath &workingDir, const QString
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << vcsCommandString(PullCommand) << extraOptions << srcLocation;
|
args << vcsCommandString(PullCommand) << extraOptions << srcLocation;
|
||||||
// Disable UNIX terminals to suppress SSH prompting
|
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ShowSuccessMessage;
|
|
||||||
|
|
||||||
// cause mercurial doesn`t understand LANG
|
// cause mercurial doesn`t understand LANG
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = Environment::systemEnvironment();
|
||||||
env.set("LANGUAGE", "C");
|
env.set("LANGUAGE", "C");
|
||||||
|
|
||||||
VcsCommand *command = VcsBaseClient::createVcsCommand(workingDir, env);
|
VcsCommand *command = VcsBaseClient::createVcsCommand(workingDir, env);
|
||||||
command->addFlags(flags);
|
command->addFlags(VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage);
|
||||||
const CommandResult result = command->runCommand({vcsBinary(), args}, vcsTimeoutS());
|
const CommandResult result = command->runCommand({vcsBinary(), args}, vcsTimeoutS());
|
||||||
delete command;
|
delete command;
|
||||||
|
|
||||||
|
@@ -222,7 +222,7 @@ void SubversionDiffEditorController::requestDescription()
|
|||||||
args << m_authenticationOptions;
|
args << m_authenticationOptions;
|
||||||
args << QLatin1String("-r");
|
args << QLatin1String("-r");
|
||||||
args << QString::number(m_changeNumber);
|
args << QString::number(m_changeNumber);
|
||||||
runCommand(QList<QStringList>() << args, VcsCommand::SshPasswordPrompt);
|
runCommand(QList<QStringList>() << args, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubversionDiffEditorController::requestDiff()
|
void SubversionDiffEditorController::requestDiff()
|
||||||
|
@@ -108,8 +108,6 @@ 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 = VcsCommand::SshPasswordPrompt | VcsCommand::ShowStdOut;
|
|
||||||
|
|
||||||
struct SubversionResponse
|
struct SubversionResponse
|
||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
@@ -694,7 +692,7 @@ 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 auto revertResponse = runSvn(state.topLevel(), args, s_defaultFlags);
|
const auto revertResponse = runSvn(state.topLevel(), args, VcsCommand::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);
|
||||||
@@ -731,7 +729,7 @@ void SubversionPluginPrivate::revertCurrentFile()
|
|||||||
args << SubversionClient::addAuthenticationOptions(m_settings);
|
args << SubversionClient::addAuthenticationOptions(m_settings);
|
||||||
args << SubversionClient::escapeFile(state.relativeCurrentFile());
|
args << SubversionClient::escapeFile(state.relativeCurrentFile());
|
||||||
|
|
||||||
const auto revertResponse = runSvn(state.currentFileTopLevel(), args, s_defaultFlags);
|
const auto revertResponse = runSvn(state.currentFileTopLevel(), args, VcsCommand::ShowStdOut);
|
||||||
|
|
||||||
if (!revertResponse.error)
|
if (!revertResponse.error)
|
||||||
emit filesChanged(QStringList(state.currentFile()));
|
emit filesChanged(QStringList(state.currentFile()));
|
||||||
@@ -900,7 +898,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 auto response = runSvn(workingDir, args, s_defaultFlags, 10);
|
const auto response = runSvn(workingDir, args, VcsCommand::ShowStdOut, 10);
|
||||||
if (!response.error)
|
if (!response.error)
|
||||||
emit repositoryChanged(workingDir);
|
emit repositoryChanged(workingDir);
|
||||||
}
|
}
|
||||||
@@ -928,8 +926,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 auto response = runSvn(workingDir, args,
|
const auto response = runSvn(workingDir, args, VcsCommand::ForceCLocale, 1, codec);
|
||||||
VcsCommand::SshPasswordPrompt | VcsCommand::ForceCLocale, 1, codec);
|
|
||||||
if (response.error)
|
if (response.error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1086,7 +1083,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 auto response = runSvn(workingDir, args, s_defaultFlags);
|
const auto response = runSvn(workingDir, args, VcsCommand::ShowStdOut);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1099,7 +1096,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 auto response = runSvn(workingDir, args, s_defaultFlags);
|
const auto response = runSvn(workingDir, args, VcsCommand::ShowStdOut);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1110,7 +1107,7 @@ bool SubversionPluginPrivate::vcsMove(const FilePath &workingDir, const QString
|
|||||||
args << QDir::toNativeSeparators(SubversionClient::escapeFile(from))
|
args << QDir::toNativeSeparators(SubversionClient::escapeFile(from))
|
||||||
<< QDir::toNativeSeparators(SubversionClient::escapeFile(to));
|
<< QDir::toNativeSeparators(SubversionClient::escapeFile(to));
|
||||||
const auto response = runSvn(workingDir, args,
|
const auto response = runSvn(workingDir, args,
|
||||||
s_defaultFlags | VcsCommand::FullySynchronously);
|
VcsCommand::ShowStdOut | VcsCommand::FullySynchronously);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1136,7 +1133,7 @@ bool SubversionPluginPrivate::vcsCheckout(const FilePath &directory, const QByte
|
|||||||
|
|
||||||
args << QLatin1String(tempUrl.toEncoded()) << directory.toString();
|
args << QLatin1String(tempUrl.toEncoded()) << directory.toString();
|
||||||
|
|
||||||
const auto response = runSvn(directory, args, VcsCommand::SshPasswordPrompt, 10);
|
const auto response = runSvn(directory, args, 0, 10);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -329,10 +329,7 @@ bool VcsBaseClient::synchronousPull(const FilePath &workingDir,
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << vcsCommandString(PullCommand) << extraOptions << srcLocation;
|
args << vcsCommandString(PullCommand) << extraOptions << srcLocation;
|
||||||
// Disable UNIX terminals to suppress SSH prompting
|
const unsigned flags = VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage;
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ShowSuccessMessage;
|
|
||||||
const bool ok = vcsSynchronousExec(workingDir, args, flags).result()
|
const bool ok = vcsSynchronousExec(workingDir, args, flags).result()
|
||||||
== ProcessResult::FinishedWithSuccess;
|
== ProcessResult::FinishedWithSuccess;
|
||||||
if (ok)
|
if (ok)
|
||||||
@@ -346,10 +343,7 @@ bool VcsBaseClient::synchronousPush(const FilePath &workingDir,
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << vcsCommandString(PushCommand) << extraOptions << dstLocation;
|
args << vcsCommandString(PushCommand) << extraOptions << dstLocation;
|
||||||
// Disable UNIX terminals to suppress SSH prompting
|
const unsigned flags = VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage;
|
||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
|
||||||
| VcsCommand::ShowStdOut
|
|
||||||
| VcsCommand::ShowSuccessMessage;
|
|
||||||
return vcsSynchronousExec(workingDir, args, flags).result()
|
return vcsSynchronousExec(workingDir, args, flags).result()
|
||||||
== ProcessResult::FinishedWithSuccess;
|
== ProcessResult::FinishedWithSuccess;
|
||||||
}
|
}
|
||||||
|
@@ -114,8 +114,7 @@ public:
|
|||||||
// triggered by file watchers).
|
// triggered by file watchers).
|
||||||
SilentOutput = 0x100, // Suppress user notifications about the output happening.
|
SilentOutput = 0x100, // Suppress user notifications about the output happening.
|
||||||
NoFullySync = 0x200, // Avoid fully synchronous execution even in UI thread.
|
NoFullySync = 0x200, // Avoid fully synchronous execution even in UI thread.
|
||||||
SshPasswordPrompt = 0x400, // Disable terminal on UNIX to force graphical prompt.
|
ExpectRepoChanges = 0x400, // Expect changes in repository by the command
|
||||||
ExpectRepoChanges = 0x800, // Expect changes in repository by the command
|
|
||||||
NoOutput = SuppressStdErr | SuppressFailMessage | SuppressCommandLogging
|
NoOutput = SuppressStdErr | SuppressFailMessage | SuppressCommandLogging
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user