2011-02-28 13:40:04 +01:00
|
|
|
/**************************************************************************
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
|
|
|
** Copyright (c) 2010 Brian McGillion & Hugues Delorme
|
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2011-02-28 13:40:04 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
**
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
|
|
|
**************************************************************************/
|
|
|
|
|
2011-10-05 15:32:16 +00:00
|
|
|
#include "command.h"
|
2011-02-28 13:40:04 +01:00
|
|
|
#include "vcsbaseclient.h"
|
2011-10-05 15:32:16 +00:00
|
|
|
#include "vcsbaseconstants.h"
|
2011-02-28 13:40:04 +01:00
|
|
|
#include "vcsbaseclientsettings.h"
|
2011-06-10 15:27:57 +00:00
|
|
|
#include "vcsbaseeditorparameterwidget.h"
|
2011-02-28 13:40:04 +01:00
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
#include <coreplugin/editormanager/editormanager.h>
|
2011-09-13 15:05:50 +00:00
|
|
|
#include <coreplugin/vcsmanager.h>
|
2011-02-28 13:40:04 +01:00
|
|
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
#include <utils/synchronousprocess.h>
|
|
|
|
#include <vcsbase/vcsbaseeditor.h>
|
|
|
|
#include <vcsbase/vcsbaseoutputwindow.h>
|
|
|
|
#include <vcsbase/vcsbaseplugin.h>
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStringList>
|
|
|
|
#include <QSharedPointer>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QProcess>
|
|
|
|
#include <QSignalMapper>
|
|
|
|
#include <QTextCodec>
|
|
|
|
#include <QtDebug>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QMetaType>
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2011-03-28 14:19:17 +02:00
|
|
|
/*!
|
2012-01-07 12:31:48 +01:00
|
|
|
\class VcsBase::VcsBaseClient
|
2011-03-28 14:19:17 +02:00
|
|
|
|
|
|
|
\brief Base class for Mercurial and Bazaar 'clients'.
|
|
|
|
|
|
|
|
Provides base functionality for common commands (diff, log, etc).
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
\sa VcsBase::VcsJobRunner
|
2011-03-28 14:19:17 +02:00
|
|
|
*/
|
|
|
|
|
2011-02-28 13:40:04 +01:00
|
|
|
Q_DECLARE_METATYPE(QVariant)
|
|
|
|
|
2012-01-24 15:36:40 +01:00
|
|
|
inline Core::IEditor *locateEditor(const char *property, const QString &entry)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2012-01-24 15:36:40 +01:00
|
|
|
foreach (Core::IEditor *ed, Core::ICore::editorManager()->openedEditors())
|
2012-02-14 16:43:51 +01:00
|
|
|
if (ed->document()->property(property).toString() == entry)
|
2011-02-28 13:40:04 +01:00
|
|
|
return ed;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-10-05 15:32:16 +00:00
|
|
|
namespace {
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseOutputWindow *vcsOutputWindow()
|
2011-10-05 15:32:16 +00:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
return VcsBase::VcsBaseOutputWindow::instance();
|
2011-10-05 15:32:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
namespace VcsBase {
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
class VcsBaseClientPrivate
|
2011-03-02 12:49:55 +01:00
|
|
|
{
|
|
|
|
public:
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClientPrivate(VcsBaseClient *client, VcsBaseClientSettings *settings);
|
2011-08-22 15:33:02 +00:00
|
|
|
|
|
|
|
void statusParser(QByteArray data);
|
|
|
|
void annotateRevision(QString source, QString change, int lineNumber);
|
|
|
|
void saveSettings();
|
2011-03-02 12:49:55 +01:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void bindCommandToEditor(Command *cmd, VcsBaseEditorWidget *editor);
|
2011-10-05 15:32:16 +00:00
|
|
|
void commandFinishedGotoLine(QObject *editorObject);
|
2011-09-14 09:13:44 +00:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClientSettings *m_clientSettings;
|
2011-10-05 15:32:16 +00:00
|
|
|
QSignalMapper *m_cmdFinishedMapper;
|
2011-08-22 15:33:02 +00:00
|
|
|
|
|
|
|
private:
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClient *m_client;
|
2011-03-02 12:49:55 +01:00
|
|
|
};
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClientPrivate::VcsBaseClientPrivate(VcsBaseClient *client, VcsBaseClientSettings *settings) :
|
2011-10-05 15:32:16 +00:00
|
|
|
m_clientSettings(settings),
|
|
|
|
m_cmdFinishedMapper(new QSignalMapper(client)),
|
|
|
|
m_client(client)
|
2011-08-22 15:33:02 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClientPrivate::statusParser(QByteArray data)
|
2011-08-22 15:33:02 +00:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
QList<VcsBaseClient::StatusItem> lineInfoList;
|
2011-08-22 15:33:02 +00:00
|
|
|
|
|
|
|
QStringList rawStatusList = QTextCodec::codecForLocale()->toUnicode(data).split(QLatin1Char('\n'));
|
|
|
|
|
|
|
|
foreach (const QString &string, rawStatusList) {
|
2012-01-07 12:31:48 +01:00
|
|
|
const VcsBaseClient::StatusItem lineInfo = m_client->parseStatusLine(string);
|
2011-08-22 15:33:03 +00:00
|
|
|
if (!lineInfo.flags.isEmpty() && !lineInfo.file.isEmpty())
|
|
|
|
lineInfoList.append(lineInfo);
|
2011-08-22 15:33:02 +00:00
|
|
|
}
|
|
|
|
|
2011-08-22 15:33:03 +00:00
|
|
|
emit m_client->parsedStatus(lineInfoList);
|
2011-08-22 15:33:02 +00:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClientPrivate::annotateRevision(QString source, QString change, int lineNumber)
|
2011-08-22 15:33:02 +00:00
|
|
|
{
|
|
|
|
// This might be invoked with a verbose revision description
|
|
|
|
// "SHA1 author subject" from the annotation context menu. Strip the rest.
|
|
|
|
const int blankPos = change.indexOf(QLatin1Char(' '));
|
|
|
|
if (blankPos != -1)
|
|
|
|
change.truncate(blankPos);
|
|
|
|
const QFileInfo fi(source);
|
|
|
|
m_client->annotate(fi.absolutePath(), fi.fileName(), change, lineNumber);
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClientPrivate::saveSettings()
|
2011-03-02 12:49:55 +01:00
|
|
|
{
|
2012-01-24 15:36:40 +01:00
|
|
|
m_clientSettings->writeSettings(Core::ICore::settings());
|
2011-03-02 12:49:55 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClientPrivate::bindCommandToEditor(Command *cmd, VcsBaseEditorWidget *editor)
|
2011-10-05 15:32:16 +00:00
|
|
|
{
|
|
|
|
QObject::connect(cmd, SIGNAL(finished(bool,int,QVariant)), m_cmdFinishedMapper, SLOT(map()));
|
|
|
|
m_cmdFinishedMapper->setMapping(cmd, editor);
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject)
|
2011-09-14 09:13:44 +00:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorWidget *editor = qobject_cast<VcsBase::VcsBaseEditorWidget *>(editorObject);
|
2011-10-05 15:32:16 +00:00
|
|
|
Command *cmd = qobject_cast<Command *>(m_cmdFinishedMapper->mapping(editor));
|
|
|
|
if (editor && cmd) {
|
|
|
|
if (cmd->lastExecutionSuccess() && cmd->cookie().type() == QVariant::Int) {
|
|
|
|
const int line = cmd->cookie().toInt();
|
|
|
|
if (line >= 0)
|
|
|
|
editor->gotoLine(line);
|
|
|
|
}
|
|
|
|
m_cmdFinishedMapper->removeMappings(cmd);
|
2011-09-14 09:13:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClient::StatusItem::StatusItem(const QString &s, const QString &f) :
|
2011-08-22 15:33:03 +00:00
|
|
|
flags(s), file(f)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClient::VcsBaseClient(VcsBaseClientSettings *settings) :
|
|
|
|
d(new VcsBaseClientPrivate(this, settings))
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
qRegisterMetaType<QVariant>();
|
2012-01-24 15:36:40 +01:00
|
|
|
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings()));
|
2011-10-05 15:32:16 +00:00
|
|
|
connect(d->m_cmdFinishedMapper, SIGNAL(mapped(QObject*)), this, SLOT(commandFinishedGotoLine(QObject*)));
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClient::~VcsBaseClient()
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2011-09-16 15:00:41 +02:00
|
|
|
delete d;
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousCreateRepository(const QString &workingDirectory,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2011-08-23 10:38:44 +00:00
|
|
|
QStringList args(vcsCommandString(CreateRepositoryCommand));
|
|
|
|
args << extraOptions;
|
2011-02-28 13:40:04 +01:00
|
|
|
QByteArray outputData;
|
|
|
|
if (!vcsFullySynchronousExec(workingDirectory, args, &outputData))
|
|
|
|
return false;
|
|
|
|
QString output = QString::fromLocal8Bit(outputData);
|
|
|
|
output.remove(QLatin1Char('\r'));
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->append(output);
|
2011-09-13 15:05:50 +00:00
|
|
|
|
|
|
|
resetCachedVcsInfo(workingDirectory);
|
|
|
|
|
2011-02-28 13:40:04 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousClone(const QString &workingDir,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString &srcLocation,
|
|
|
|
const QString &dstLocation,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args;
|
|
|
|
args << vcsCommandString(CloneCommand)
|
2011-08-23 10:38:44 +00:00
|
|
|
<< extraOptions << srcLocation << dstLocation;
|
2011-02-28 13:40:04 +01:00
|
|
|
QByteArray stdOut;
|
2011-09-13 15:05:50 +00:00
|
|
|
const bool cloneOk = vcsFullySynchronousExec(workingDir, args, &stdOut);
|
|
|
|
resetCachedVcsInfo(workingDir);
|
|
|
|
return cloneOk;
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &filename,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args;
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCommandString(AddCommand) << extraOptions << filename;
|
2011-02-28 13:40:04 +01:00
|
|
|
QByteArray stdOut;
|
|
|
|
return vcsFullySynchronousExec(workingDir, args, &stdOut);
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &filename,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args;
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCommandString(RemoveCommand) << extraOptions << filename;
|
2011-02-28 13:40:04 +01:00
|
|
|
QByteArray stdOut;
|
|
|
|
return vcsFullySynchronousExec(workingDir, args, &stdOut);
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QString &from, const QString &to,
|
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args;
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCommandString(MoveCommand) << extraOptions << from << to;
|
2011-02-28 13:40:04 +01:00
|
|
|
QByteArray stdOut;
|
|
|
|
return vcsFullySynchronousExec(workingDir, args, &stdOut);
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString &srcLocation,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args;
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCommandString(PullCommand) << extraOptions << srcLocation;
|
2011-02-28 13:40:04 +01:00
|
|
|
// Disable UNIX terminals to suppress SSH prompting
|
|
|
|
const unsigned flags =
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBasePlugin::SshPasswordPrompt
|
|
|
|
| VcsBase::VcsBasePlugin::ShowStdOutInLogWindow
|
|
|
|
| VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
2011-02-28 13:40:04 +01:00
|
|
|
const Utils::SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags);
|
|
|
|
const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished;
|
|
|
|
if (ok)
|
|
|
|
emit changed(QVariant(workingDir));
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::synchronousPush(const QString &workingDir,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString &dstLocation,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args;
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCommandString(PushCommand) << extraOptions << dstLocation;
|
2011-02-28 13:40:04 +01:00
|
|
|
// Disable UNIX terminals to suppress SSH prompting
|
|
|
|
const unsigned flags =
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBasePlugin::SshPasswordPrompt
|
|
|
|
| VcsBase::VcsBasePlugin::ShowStdOutInLogWindow
|
|
|
|
| VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
2011-02-28 13:40:04 +01:00
|
|
|
const Utils::SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags);
|
|
|
|
return resp.result == Utils::SynchronousProcessResponse::Finished;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QStringList &args,
|
|
|
|
QByteArray *output)
|
|
|
|
{
|
|
|
|
QProcess vcsProcess;
|
|
|
|
if (!workingDir.isEmpty())
|
|
|
|
vcsProcess.setWorkingDirectory(workingDir);
|
2011-10-05 15:32:16 +00:00
|
|
|
vcsProcess.setProcessEnvironment(processEnvironment());
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString binary = settings()->stringValue(VcsBaseClientSettings::binaryPathKey);
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->appendCommand(workingDir, binary, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2011-09-14 09:13:44 +00:00
|
|
|
vcsProcess.start(binary, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
|
|
|
|
if (!vcsProcess.waitForStarted()) {
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->appendError(tr("Unable to start process '%1': %2")
|
|
|
|
.arg(QDir::toNativeSeparators(binary), vcsProcess.errorString()));
|
2011-02-28 13:40:04 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
vcsProcess.closeWriteChannel();
|
|
|
|
|
|
|
|
QByteArray stdErr;
|
2012-01-07 12:31:48 +01:00
|
|
|
const int timeoutSec = settings()->intValue(VcsBaseClientSettings::timeoutKey);
|
2011-09-14 09:13:44 +00:00
|
|
|
if (!Utils::SynchronousProcess::readDataFromProcess(vcsProcess, timeoutSec * 1000,
|
2011-02-28 13:40:04 +01:00
|
|
|
output, &stdErr, true)) {
|
|
|
|
Utils::SynchronousProcess::stopProcess(vcsProcess);
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->appendError(tr("Timed out after %1s waiting for the process %2 to finish.")
|
|
|
|
.arg(timeoutSec).arg(binary));
|
2011-02-28 13:40:04 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!stdErr.isEmpty())
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->append(QString::fromLocal8Bit(stdErr));
|
2011-02-28 13:40:04 +01:00
|
|
|
|
|
|
|
return vcsProcess.exitStatus() == QProcess::NormalExit && vcsProcess.exitCode() == 0;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
Utils::SynchronousProcessResponse VcsBaseClient::vcsSynchronousExec(
|
2011-10-05 15:32:16 +00:00
|
|
|
const QString &workingDirectory,
|
|
|
|
const QStringList &args,
|
|
|
|
unsigned flags,
|
|
|
|
QTextCodec *outputCodec)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString binary = settings()->stringValue(VcsBaseClientSettings::binaryPathKey);
|
|
|
|
const int timeoutSec = settings()->intValue(VcsBaseClientSettings::timeoutKey);
|
|
|
|
return VcsBase::VcsBasePlugin::runVcs(workingDirectory, binary, args,
|
2011-09-14 09:13:44 +00:00
|
|
|
timeoutSec * 1000, flags, outputCodec);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::annotate(const QString &workingDir, const QString &file,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString revision /* = QString() */,
|
2011-08-23 10:38:44 +00:00
|
|
|
int lineNumber /* = -1 */,
|
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
Q_UNUSED(lineNumber)
|
|
|
|
const QString vcsCmdString = vcsCommandString(AnnotateCommand);
|
|
|
|
QStringList args;
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCmdString << revisionSpec(revision) << extraOptions << file;
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString kind = vcsEditorKind(AnnotateCommand);
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString id = VcsBase::VcsBaseEditorWidget::getSource(workingDir, QStringList(file));
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString title = vcsEditorTitle(vcsCmdString, id);
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, file);
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true,
|
2011-02-28 13:40:04 +01:00
|
|
|
vcsCmdString.toLatin1().constData(), id);
|
|
|
|
|
2011-10-05 15:32:16 +00:00
|
|
|
Command *cmd = createCommand(workingDir, editor);
|
|
|
|
cmd->setCookie(lineNumber);
|
|
|
|
enqueueJob(cmd, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::diff(const QString &workingDir, const QStringList &files,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
const QString vcsCmdString = vcsCommandString(DiffCommand);
|
|
|
|
const QString kind = vcsEditorKind(DiffCommand);
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files);
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString title = vcsEditorTitle(vcsCmdString, id);
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files);
|
|
|
|
VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true,
|
2011-02-28 13:40:04 +01:00
|
|
|
vcsCmdString.toLatin1().constData(), id);
|
|
|
|
editor->setDiffBaseDirectory(workingDir);
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseEditorParameterWidget *paramWidget = createDiffEditor(workingDir, files, extraOptions);
|
2011-06-10 15:27:57 +00:00
|
|
|
if (paramWidget != 0) {
|
2012-01-07 12:31:48 +01:00
|
|
|
connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)),
|
2011-06-10 15:27:57 +00:00
|
|
|
paramWidget, SLOT(executeCommand()));
|
|
|
|
editor->setConfigurationWidget(paramWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
QStringList args;
|
|
|
|
const QStringList paramArgs = paramWidget != 0 ? paramWidget->arguments() : QStringList();
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCmdString << extraOptions << paramArgs << files;
|
2011-10-05 15:32:16 +00:00
|
|
|
enqueueJob(createCommand(workingDir, editor), args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::log(const QString &workingDir, const QStringList &files,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions,
|
2011-02-28 13:40:04 +01:00
|
|
|
bool enableAnnotationContextMenu)
|
|
|
|
{
|
|
|
|
const QString vcsCmdString = vcsCommandString(LogCommand);
|
|
|
|
const QString kind = vcsEditorKind(LogCommand);
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files);
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString title = vcsEditorTitle(vcsCmdString, id);
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files);
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true,
|
2011-02-28 13:40:04 +01:00
|
|
|
vcsCmdString.toLatin1().constData(), id);
|
|
|
|
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseEditorParameterWidget *paramWidget = createLogEditor(workingDir, files, extraOptions);
|
2011-07-28 10:22:11 +00:00
|
|
|
if (paramWidget != 0)
|
|
|
|
editor->setConfigurationWidget(paramWidget);
|
|
|
|
|
|
|
|
QStringList args;
|
|
|
|
const QStringList paramArgs = paramWidget != 0 ? paramWidget->arguments() : QStringList();
|
2011-08-23 10:38:44 +00:00
|
|
|
args << vcsCmdString << extraOptions << paramArgs << files;
|
2011-10-05 15:32:16 +00:00
|
|
|
enqueueJob(createCommand(workingDir, editor), args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::revertFile(const QString &workingDir,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString &file,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QString &revision,
|
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args(vcsCommandString(RevertCommand));
|
2011-08-23 10:38:44 +00:00
|
|
|
args << revisionSpec(revision) << extraOptions << file;
|
2011-02-28 13:40:04 +01:00
|
|
|
// Indicate repository change or file list
|
2011-10-05 15:32:16 +00:00
|
|
|
Command *cmd = createCommand(workingDir);
|
|
|
|
cmd->setCookie(QStringList(workingDir + QLatin1Char('/') + file));
|
|
|
|
connect(cmd, SIGNAL(success(QVariant)), this, SIGNAL(changed(QVariant)), Qt::QueuedConnection);
|
|
|
|
enqueueJob(cmd, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::revertAll(const QString &workingDir, const QString &revision,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args(vcsCommandString(RevertCommand));
|
2011-08-23 10:38:44 +00:00
|
|
|
args << revisionSpec(revision) << extraOptions;
|
2011-02-28 13:40:04 +01:00
|
|
|
// Indicate repository change or file list
|
2011-10-05 15:32:16 +00:00
|
|
|
Command *cmd = createCommand(workingDir);
|
|
|
|
cmd->setCookie(QStringList(workingDir));
|
|
|
|
connect(cmd, SIGNAL(success(QVariant)), this, SIGNAL(changed(QVariant)), Qt::QueuedConnection);
|
|
|
|
enqueueJob(createCommand(workingDir), args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::status(const QString &workingDir, const QString &file,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args(vcsCommandString(StatusCommand));
|
2011-08-23 10:38:44 +00:00
|
|
|
args << extraOptions << file;
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->setRepository(workingDir);
|
|
|
|
Command *cmd = createCommand(workingDir, 0, VcsWindowOutputBind);
|
|
|
|
connect(cmd, SIGNAL(finished(bool,int,QVariant)), ::vcsOutputWindow(), SLOT(clearRepository()),
|
|
|
|
Qt::QueuedConnection);
|
|
|
|
enqueueJob(cmd, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::emitParsedStatus(const QString &repository, const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args(vcsCommandString(StatusCommand));
|
2011-08-22 15:33:03 +00:00
|
|
|
args << extraOptions;
|
2011-10-05 15:32:16 +00:00
|
|
|
Command *cmd = createCommand(repository);
|
|
|
|
connect(cmd, SIGNAL(outputData(QByteArray)), this, SLOT(statusParser(QByteArray)));
|
|
|
|
enqueueJob(cmd, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
QString VcsBaseClient::vcsCommandString(VcsCommand cmd) const
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2011-02-28 15:05:40 +01:00
|
|
|
switch (cmd) {
|
|
|
|
case CreateRepositoryCommand: return QLatin1String("init");
|
|
|
|
case CloneCommand: return QLatin1String("clone");
|
|
|
|
case AddCommand: return QLatin1String("add");
|
|
|
|
case RemoveCommand: return QLatin1String("remove");
|
|
|
|
case MoveCommand: return QLatin1String("rename");
|
|
|
|
case PullCommand: return QLatin1String("pull");
|
|
|
|
case PushCommand: return QLatin1String("push");
|
|
|
|
case CommitCommand: return QLatin1String("commit");
|
|
|
|
case ImportCommand: return QLatin1String("import");
|
|
|
|
case UpdateCommand: return QLatin1String("update");
|
|
|
|
case RevertCommand: return QLatin1String("revert");
|
|
|
|
case AnnotateCommand: return QLatin1String("annotate");
|
|
|
|
case DiffCommand: return QLatin1String("diff");
|
|
|
|
case LogCommand: return QLatin1String("log");
|
|
|
|
case StatusCommand: return QLatin1String("status");
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
2011-02-28 15:05:40 +01:00
|
|
|
return QString();
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::import(const QString &repositoryRoot, const QStringList &files,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args(vcsCommandString(ImportCommand));
|
2011-08-23 10:38:44 +00:00
|
|
|
args << extraOptions << files;
|
2011-10-05 15:32:16 +00:00
|
|
|
enqueueJob(createCommand(repositoryRoot), args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::view(const QString &source, const QString &id,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2011-08-23 10:38:44 +00:00
|
|
|
QStringList args;
|
|
|
|
args << extraOptions << revisionSpec(id);
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString kind = vcsEditorKind(DiffCommand);
|
|
|
|
const QString title = vcsEditorTitle(vcsCommandString(LogCommand), id);
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source,
|
2011-02-28 13:40:04 +01:00
|
|
|
true, "view", id);
|
|
|
|
|
2011-03-25 10:12:51 +01:00
|
|
|
const QFileInfo fi(source);
|
|
|
|
const QString workingDirPath = fi.isFile() ? fi.absolutePath() : source;
|
2011-10-05 15:32:16 +00:00
|
|
|
enqueueJob(createCommand(workingDirPath, editor), args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::update(const QString &repositoryRoot, const QString &revision,
|
2011-08-23 10:38:44 +00:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
|
|
|
QStringList args(vcsCommandString(UpdateCommand));
|
2011-08-23 10:38:44 +00:00
|
|
|
args << revisionSpec(revision) << extraOptions;
|
2011-10-05 15:32:16 +00:00
|
|
|
Command *cmd = createCommand(repositoryRoot);
|
|
|
|
cmd->setCookie(repositoryRoot);
|
2012-01-07 12:31:48 +01:00
|
|
|
cmd->setUnixTerminalDisabled(VcsBase::VcsBasePlugin::isSshPromptConfigured());
|
2011-10-05 15:32:16 +00:00
|
|
|
connect(cmd, SIGNAL(success(QVariant)), this, SIGNAL(changed(QVariant)), Qt::QueuedConnection);
|
|
|
|
enqueueJob(cmd, args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::commit(const QString &repositoryRoot,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QStringList &files,
|
|
|
|
const QString &commitMessageFile,
|
2011-05-12 14:48:10 +02:00
|
|
|
const QStringList &extraOptions)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2011-08-23 10:38:44 +00:00
|
|
|
// Handling of commitMessageFile is a bit tricky :
|
2012-01-07 12:31:48 +01:00
|
|
|
// VcsBaseClient cannot do something with it because it doesn't know which
|
2011-08-23 10:38:44 +00:00
|
|
|
// option to use (-F ? but sub VCS clients might require a different option
|
|
|
|
// name like -l for hg ...)
|
|
|
|
//
|
2012-01-07 12:31:48 +01:00
|
|
|
// So descendants of VcsBaseClient *must* redefine commit() and extend
|
2011-08-23 10:38:44 +00:00
|
|
|
// extraOptions with the usage for commitMessageFile (see BazaarClient::commit()
|
|
|
|
// for example)
|
|
|
|
Q_UNUSED(commitMessageFile);
|
2011-02-28 13:40:04 +01:00
|
|
|
QStringList args(vcsCommandString(CommitCommand));
|
2011-08-23 10:38:44 +00:00
|
|
|
args << extraOptions << files;
|
2011-10-05 15:32:16 +00:00
|
|
|
enqueueJob(createCommand(repositoryRoot), args);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseClientSettings *VcsBaseClient::settings() const
|
2011-03-15 15:47:45 +01:00
|
|
|
{
|
|
|
|
return d->m_clientSettings;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseEditorParameterWidget *VcsBaseClient::createDiffEditor(const QString &workingDir,
|
2011-06-10 15:27:57 +00:00
|
|
|
const QStringList &files,
|
|
|
|
const QStringList &extraOptions)
|
2011-03-28 11:59:26 +02:00
|
|
|
{
|
2011-06-10 15:27:57 +00:00
|
|
|
Q_UNUSED(workingDir);
|
|
|
|
Q_UNUSED(files);
|
|
|
|
Q_UNUSED(extraOptions);
|
|
|
|
return 0;
|
2011-03-28 11:59:26 +02:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBaseEditorParameterWidget *VcsBaseClient::createLogEditor(const QString &workingDir,
|
2011-07-28 10:22:11 +00:00
|
|
|
const QStringList &files,
|
|
|
|
const QStringList &extraOptions)
|
|
|
|
{
|
|
|
|
Q_UNUSED(workingDir);
|
|
|
|
Q_UNUSED(files);
|
|
|
|
Q_UNUSED(extraOptions);
|
|
|
|
return 0;
|
|
|
|
}
|
2011-06-10 15:27:57 +00:00
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sourceId) const
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString binary = settings()->stringValue(VcsBaseClientSettings::binaryPathKey);
|
2011-09-14 09:13:44 +00:00
|
|
|
return QFileInfo(binary).baseName() +
|
2011-03-14 11:18:49 +01:00
|
|
|
QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') +
|
|
|
|
QFileInfo(sourceId).fileName();
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(const QString &kind, QString title,
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString &source, bool setSourceCodec,
|
|
|
|
const char *registerDynamicProperty,
|
|
|
|
const QString &dynamicPropertyValue) const
|
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBaseEditorWidget *baseEditor = 0;
|
2012-01-24 15:36:40 +01:00
|
|
|
Core::IEditor *outputEditor = locateEditor(registerDynamicProperty, dynamicPropertyValue);
|
2011-02-28 13:40:04 +01:00
|
|
|
const QString progressMsg = tr("Working...");
|
|
|
|
if (outputEditor) {
|
|
|
|
// Exists already
|
|
|
|
outputEditor->createNew(progressMsg);
|
2012-01-07 12:31:48 +01:00
|
|
|
baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor);
|
2011-02-28 13:40:04 +01:00
|
|
|
QTC_ASSERT(baseEditor, return 0);
|
|
|
|
} else {
|
2012-05-08 09:43:14 +02:00
|
|
|
outputEditor = Core::EditorManager::openEditorWithContents(Core::Id(kind), &title, progressMsg);
|
2012-02-14 16:43:51 +01:00
|
|
|
outputEditor->document()->setProperty(registerDynamicProperty, dynamicPropertyValue);
|
2012-01-07 12:31:48 +01:00
|
|
|
baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor);
|
2011-02-28 13:40:04 +01:00
|
|
|
connect(baseEditor, SIGNAL(annotateRevisionRequested(QString,QString,int)),
|
2011-08-22 15:33:02 +00:00
|
|
|
this, SLOT(annotateRevision(QString,QString,int)));
|
2011-02-28 13:40:04 +01:00
|
|
|
QTC_ASSERT(baseEditor, return 0);
|
|
|
|
baseEditor->setSource(source);
|
|
|
|
if (setSourceCodec)
|
2012-01-07 12:31:48 +01:00
|
|
|
baseEditor->setCodec(VcsBase::VcsBaseEditorWidget::getCodec(source));
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
baseEditor->setForceReadOnly(true);
|
2012-05-08 09:43:14 +02:00
|
|
|
Core::EditorManager::activateEditor(outputEditor, Core::EditorManager::ModeSwitch);
|
2011-02-28 13:40:04 +01:00
|
|
|
return baseEditor;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
QProcessEnvironment VcsBaseClient::processEnvironment() const
|
2011-09-13 15:05:50 +00:00
|
|
|
{
|
2011-10-05 15:32:16 +00:00
|
|
|
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
2012-01-07 12:31:48 +01:00
|
|
|
VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false);
|
2011-10-05 15:32:16 +00:00
|
|
|
return environment;
|
2011-09-13 15:05:50 +00:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
Command *VcsBaseClient::createCommand(const QString &workingDirectory,
|
|
|
|
VcsBase::VcsBaseEditorWidget *editor,
|
2011-10-05 15:32:16 +00:00
|
|
|
JobOutputBindMode mode)
|
2011-02-28 13:40:04 +01:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
Command *cmd = new Command(d->m_clientSettings->stringValue(VcsBaseClientSettings::binaryPathKey),
|
2011-10-05 15:32:16 +00:00
|
|
|
workingDirectory, processEnvironment());
|
2012-01-07 12:31:48 +01:00
|
|
|
cmd->setDefaultTimeout(d->m_clientSettings->intValue(VcsBaseClientSettings::timeoutKey));
|
2011-10-05 15:32:16 +00:00
|
|
|
if (editor)
|
|
|
|
d->bindCommandToEditor(cmd, editor);
|
|
|
|
if (mode == VcsWindowOutputBind) {
|
|
|
|
if (editor) { // assume that the commands output is the important thing
|
|
|
|
connect(cmd, SIGNAL(outputData(QByteArray)),
|
|
|
|
::vcsOutputWindow(), SLOT(appendDataSilently(QByteArray)));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
connect(cmd, SIGNAL(outputData(QByteArray)),
|
|
|
|
::vcsOutputWindow(), SLOT(appendData(QByteArray)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (editor) {
|
|
|
|
connect(cmd, SIGNAL(outputData(QByteArray)),
|
|
|
|
editor, SLOT(setPlainTextData(QByteArray)));
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
2011-10-05 15:32:16 +00:00
|
|
|
|
|
|
|
if (::vcsOutputWindow())
|
|
|
|
connect(cmd, SIGNAL(errorText(QString)),
|
|
|
|
::vcsOutputWindow(), SLOT(appendError(QString)));
|
|
|
|
return cmd;
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::enqueueJob(Command *cmd, const QStringList &args)
|
2011-10-05 15:32:16 +00:00
|
|
|
{
|
2012-01-07 12:31:48 +01:00
|
|
|
const QString binary = QFileInfo(d->m_clientSettings->stringValue(VcsBaseClientSettings::binaryPathKey)).baseName();
|
2011-10-05 15:32:16 +00:00
|
|
|
::vcsOutputWindow()->appendCommand(cmd->workingDirectory(), binary, args);
|
|
|
|
cmd->addJob(args);
|
|
|
|
cmd->execute();
|
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
void VcsBaseClient::resetCachedVcsInfo(const QString &workingDir)
|
2011-10-05 15:32:16 +00:00
|
|
|
{
|
2012-01-24 15:36:40 +01:00
|
|
|
Core::ICore::vcsManager()->resetVersionControlForDirectory(workingDir);
|
2011-02-28 13:40:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
} // namespace VcsBase
|
2011-08-22 15:33:02 +00:00
|
|
|
|
|
|
|
#include "moc_vcsbaseclient.cpp"
|