forked from qt-creator/qt-creator
Git: Add using VcsBase::VcsBasePlugin
Less noise Change-Id: I5c13af770f04ae411b09ed824cf93d2768b8e224 Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
050d13726a
commit
aae82f0e29
@@ -80,6 +80,8 @@ static const char HEAD[] = "HEAD";
|
|||||||
namespace Git {
|
namespace Git {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
using VcsBase::VcsBasePlugin;
|
||||||
|
|
||||||
class GitDiffHandler : public QObject
|
class GitDiffHandler : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -2138,7 +2140,7 @@ QProcessEnvironment GitClient::processEnvironment() const
|
|||||||
}
|
}
|
||||||
environment.insert(QLatin1String("GIT_EDITOR"), m_disableEditor ? QLatin1String("true") : m_gitQtcEditor);
|
environment.insert(QLatin1String("GIT_EDITOR"), m_disableEditor ? QLatin1String("true") : m_gitQtcEditor);
|
||||||
// Set up SSH and C locale (required by git using perl).
|
// Set up SSH and C locale (required by git using perl).
|
||||||
VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false);
|
VcsBasePlugin::setProcessEnvironment(&environment, false);
|
||||||
return environment;
|
return environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2181,10 +2183,10 @@ Utils::SynchronousProcessResponse GitClient::synchronousGit(const QString &worki
|
|||||||
unsigned flags,
|
unsigned flags,
|
||||||
QTextCodec *stdOutCodec)
|
QTextCodec *stdOutCodec)
|
||||||
{
|
{
|
||||||
return VcsBase::VcsBasePlugin::runVcs(workingDirectory, gitBinaryPath(), gitArguments,
|
return VcsBasePlugin::runVcs(workingDirectory, gitBinaryPath(), gitArguments,
|
||||||
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
||||||
processEnvironment(),
|
processEnvironment(),
|
||||||
flags, stdOutCodec);
|
flags, stdOutCodec);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::fullySynchronousGit(const QString &workingDirectory,
|
bool GitClient::fullySynchronousGit(const QString &workingDirectory,
|
||||||
@@ -2193,10 +2195,10 @@ bool GitClient::fullySynchronousGit(const QString &workingDirectory,
|
|||||||
QByteArray* errorText,
|
QByteArray* errorText,
|
||||||
bool logCommandToWindow) const
|
bool logCommandToWindow) const
|
||||||
{
|
{
|
||||||
return VcsBase::VcsBasePlugin::runFullySynchronous(workingDirectory, gitBinaryPath(), gitArguments,
|
return VcsBasePlugin::runFullySynchronous(workingDirectory, gitBinaryPath(), gitArguments,
|
||||||
processEnvironment(), outputText, errorText,
|
processEnvironment(), outputText, errorText,
|
||||||
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
||||||
logCommandToWindow);
|
logCommandToWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::submoduleUpdate(const QString &workingDirectory)
|
void GitClient::submoduleUpdate(const QString &workingDirectory)
|
||||||
@@ -2376,9 +2378,9 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
|||||||
QStringList arguments(QLatin1String("ls-remote"));
|
QStringList arguments(QLatin1String("ls-remote"));
|
||||||
arguments << repositoryURL << QLatin1String(HEAD) << QLatin1String("refs/heads/*");
|
arguments << repositoryURL << QLatin1String(HEAD) << QLatin1String("refs/heads/*");
|
||||||
const unsigned flags =
|
const unsigned flags =
|
||||||
VcsBase::VcsBasePlugin::SshPasswordPrompt|
|
VcsBasePlugin::SshPasswordPrompt|
|
||||||
VcsBase::VcsBasePlugin::SuppressStdErrInLogWindow|
|
VcsBasePlugin::SuppressStdErrInLogWindow|
|
||||||
VcsBase::VcsBasePlugin::SuppressFailMessageInLogWindow;
|
VcsBasePlugin::SuppressFailMessageInLogWindow;
|
||||||
const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
|
const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
|
||||||
QStringList branches;
|
QStringList branches;
|
||||||
branches << tr("<Detached HEAD>");
|
branches << tr("<Detached HEAD>");
|
||||||
@@ -2838,7 +2840,7 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
|
|||||||
const QString &abortCommand)
|
const QString &abortCommand)
|
||||||
{
|
{
|
||||||
// Disable UNIX terminals to suppress SSH prompting.
|
// Disable UNIX terminals to suppress SSH prompting.
|
||||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow;
|
const unsigned flags = VcsBasePlugin::SshPasswordPrompt | VcsBasePlugin::ShowStdOutInLogWindow;
|
||||||
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags);
|
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags);
|
||||||
ConflictHandler conflictHandler(0, workingDirectory, abortCommand);
|
ConflictHandler conflictHandler(0, workingDirectory, abortCommand);
|
||||||
// Notify about changed files or abort the rebase.
|
// Notify about changed files or abort the rebase.
|
||||||
@@ -2942,8 +2944,8 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory)
|
|||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("svn") << QLatin1String("fetch");
|
args << QLatin1String("svn") << QLatin1String("fetch");
|
||||||
// Disable UNIX terminals to suppress SSH prompting.
|
// Disable UNIX terminals to suppress SSH prompting.
|
||||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow
|
const unsigned flags = VcsBasePlugin::SshPasswordPrompt|VcsBasePlugin::ShowStdOutInLogWindow
|
||||||
|VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
|VcsBasePlugin::ShowSuccessMessage;
|
||||||
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, args, flags);
|
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, args, flags);
|
||||||
// Notify about changes.
|
// Notify about changes.
|
||||||
if (resp.result == Utils::SynchronousProcessResponse::Finished)
|
if (resp.result == Utils::SynchronousProcessResponse::Finished)
|
||||||
@@ -3206,9 +3208,9 @@ QString GitClient::readConfigValue(const QString &workingDirectory, const QStrin
|
|||||||
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
|
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
|
||||||
{
|
{
|
||||||
QDir workingDirectory(directory);
|
QDir workingDirectory(directory);
|
||||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt |
|
const unsigned flags = VcsBasePlugin::SshPasswordPrompt |
|
||||||
VcsBase::VcsBasePlugin::ShowStdOutInLogWindow|
|
VcsBasePlugin::ShowStdOutInLogWindow|
|
||||||
VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
VcsBasePlugin::ShowSuccessMessage;
|
||||||
|
|
||||||
if (workingDirectory.exists()) {
|
if (workingDirectory.exists()) {
|
||||||
if (!synchronousInit(workingDirectory.path()))
|
if (!synchronousInit(workingDirectory.path()))
|
||||||
|
Reference in New Issue
Block a user