forked from qt-creator/qt-creator
VCS: Use namespace Utils
Change-Id: I41c818362398fd194995baf5b1adb16899e83217 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
dc29aafb52
commit
afb60d0434
@@ -50,6 +50,8 @@
|
||||
#include <QVariant>
|
||||
#include <QProcessEnvironment>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
/*!
|
||||
\class VcsBase::VcsBaseClient
|
||||
|
||||
@@ -108,7 +110,7 @@ VcsBaseClientSettings &VcsBaseClientImpl::settings() const
|
||||
return *d->m_clientSettings;
|
||||
}
|
||||
|
||||
Utils::FileName VcsBaseClientImpl::vcsBinary() const
|
||||
FileName VcsBaseClientImpl::vcsBinary() const
|
||||
{
|
||||
return settings().binaryPath();
|
||||
}
|
||||
@@ -134,7 +136,7 @@ VcsCommand *VcsBaseClientImpl::createCommand(const QString &workingDirectory,
|
||||
|
||||
void VcsBaseClientImpl::enqueueJob(VcsCommand *cmd, const QStringList &args,
|
||||
const QString &workingDirectory,
|
||||
const Utils::ExitCodeInterpreter &interpreter) const
|
||||
const ExitCodeInterpreter &interpreter) const
|
||||
{
|
||||
cmd->addJob(vcsBinary(), args, vcsTimeoutS(), workingDirectory, interpreter);
|
||||
cmd->execute();
|
||||
@@ -149,7 +151,7 @@ QProcessEnvironment VcsBaseClientImpl::processEnvironment() const
|
||||
|
||||
QString VcsBaseClientImpl::commandOutputFromLocal8Bit(const QByteArray &a)
|
||||
{
|
||||
return Utils::SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(a));
|
||||
return SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(a));
|
||||
}
|
||||
|
||||
QStringList VcsBaseClientImpl::commandOutputLinesFromLocal8Bit(const QByteArray &a)
|
||||
@@ -175,8 +177,8 @@ QString VcsBaseClientImpl::stripLastNewline(const QString &in)
|
||||
return in;
|
||||
}
|
||||
|
||||
Utils::SynchronousProcessResponse
|
||||
VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const Utils::FileName &binary,
|
||||
SynchronousProcessResponse
|
||||
VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const FileName &binary,
|
||||
const QStringList &args, unsigned flags,
|
||||
int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
@@ -205,7 +207,7 @@ void VcsBaseClientImpl::annotateRevisionRequested(const QString &workingDirector
|
||||
annotate(workingDirectory, file, changeCopy, line);
|
||||
}
|
||||
|
||||
Utils::SynchronousProcessResponse
|
||||
SynchronousProcessResponse
|
||||
VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const QStringList &args,
|
||||
unsigned flags, int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
@@ -226,10 +228,10 @@ VcsCommand *VcsBaseClientImpl::vcsExec(const QString &workingDirectory, const QS
|
||||
return command;
|
||||
}
|
||||
|
||||
Utils::SynchronousProcessResponse VcsBaseClientImpl::vcsSynchronousExec(const QString &workingDir,
|
||||
const QStringList &args,
|
||||
unsigned flags,
|
||||
QTextCodec *outputCodec) const
|
||||
SynchronousProcessResponse VcsBaseClientImpl::vcsSynchronousExec(const QString &workingDir,
|
||||
const QStringList &args,
|
||||
unsigned flags,
|
||||
QTextCodec *outputCodec) const
|
||||
{
|
||||
return VcsBasePlugin::runVcs(workingDir, vcsBinary(), args, vcsTimeoutS(), flags,
|
||||
outputCodec, processEnvironment());
|
||||
@@ -316,8 +318,8 @@ bool VcsBaseClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
{
|
||||
QStringList args(vcsCommandString(CreateRepositoryCommand));
|
||||
args << extraOptions;
|
||||
Utils::SynchronousProcessResponse result = vcsFullySynchronousExec(workingDirectory, args);
|
||||
if (result.result != Utils::SynchronousProcessResponse::Finished)
|
||||
SynchronousProcessResponse result = vcsFullySynchronousExec(workingDirectory, args);
|
||||
if (result.result != SynchronousProcessResponse::Finished)
|
||||
return false;
|
||||
VcsOutputWindow::append(result.stdOut());
|
||||
|
||||
@@ -335,9 +337,9 @@ bool VcsBaseClient::synchronousClone(const QString &workingDir,
|
||||
args << vcsCommandString(CloneCommand)
|
||||
<< extraOptions << srcLocation << dstLocation;
|
||||
|
||||
Utils::SynchronousProcessResponse result = vcsFullySynchronousExec(workingDir, args);
|
||||
SynchronousProcessResponse result = vcsFullySynchronousExec(workingDir, args);
|
||||
resetCachedVcsInfo(workingDir);
|
||||
return result.result == Utils::SynchronousProcessResponse::Finished;
|
||||
return result.result == SynchronousProcessResponse::Finished;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &filename,
|
||||
@@ -345,7 +347,7 @@ bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &fil
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(AddCommand) << extraOptions << filename;
|
||||
return vcsFullySynchronousExec(workingDir, args).result == Utils::SynchronousProcessResponse::Finished;
|
||||
return vcsFullySynchronousExec(workingDir, args).result == SynchronousProcessResponse::Finished;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &filename,
|
||||
@@ -353,7 +355,7 @@ bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(RemoveCommand) << extraOptions << filename;
|
||||
return vcsFullySynchronousExec(workingDir, args).result == Utils::SynchronousProcessResponse::Finished;
|
||||
return vcsFullySynchronousExec(workingDir, args).result == SynchronousProcessResponse::Finished;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
@@ -362,7 +364,7 @@ bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(MoveCommand) << extraOptions << from << to;
|
||||
return vcsFullySynchronousExec(workingDir, args).result == Utils::SynchronousProcessResponse::Finished;
|
||||
return vcsFullySynchronousExec(workingDir, args).result == SynchronousProcessResponse::Finished;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
@@ -376,8 +378,8 @@ bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
VcsCommand::SshPasswordPrompt
|
||||
| VcsCommand::ShowStdOut
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
const Utils::SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags);
|
||||
const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished;
|
||||
const SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags);
|
||||
const bool ok = resp.result == SynchronousProcessResponse::Finished;
|
||||
if (ok)
|
||||
emit changed(QVariant(workingDir));
|
||||
return ok;
|
||||
@@ -394,8 +396,8 @@ bool VcsBaseClient::synchronousPush(const QString &workingDir,
|
||||
VcsCommand::SshPasswordPrompt
|
||||
| VcsCommand::ShowStdOut
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
const Utils::SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags);
|
||||
return resp.result == Utils::SynchronousProcessResponse::Finished;
|
||||
const SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags);
|
||||
return resp.result == SynchronousProcessResponse::Finished;
|
||||
}
|
||||
|
||||
VcsBaseEditorWidget *VcsBaseClient::annotate(
|
||||
@@ -564,7 +566,7 @@ QString VcsBaseClient::vcsCommandString(VcsCommandTag cmd) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
Utils::ExitCodeInterpreter VcsBaseClient::exitCodeInterpreter(VcsCommandTag cmd) const
|
||||
ExitCodeInterpreter VcsBaseClient::exitCodeInterpreter(VcsCommandTag cmd) const
|
||||
{
|
||||
Q_UNUSED(cmd)
|
||||
return Utils::defaultExitCodeInterpreter;
|
||||
@@ -640,7 +642,7 @@ QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sour
|
||||
{
|
||||
return vcsBinary().toFileInfo().baseName() +
|
||||
QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') +
|
||||
Utils::FileName::fromString(sourceId).fileName();
|
||||
FileName::fromString(sourceId).fileName();
|
||||
}
|
||||
|
||||
void VcsBaseClient::statusParser(const QString &text)
|
||||
|
||||
Reference in New Issue
Block a user