forked from qt-creator/qt-creator
vcs: s/VCS/Vcs/
According to style guide. Change-Id: I05c1d4f50ddbf2876ab7e0835f4abec95fd573b2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Internal {
|
||||
|
||||
GitAnnotationHighlighter::GitAnnotationHighlighter(const ChangeNumbers &changeNumbers,
|
||||
QTextDocument *document) :
|
||||
VCSBase::BaseAnnotationHighlighter(changeNumbers, document),
|
||||
VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
|
||||
m_blank(QLatin1Char(' '))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
// Annotation highlighter for p4 triggering on 'changenumber:'
|
||||
class GitAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter
|
||||
class GitAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -92,7 +92,7 @@ void BranchDialog::refresh(const QString &repository, bool force)
|
||||
m_ui->repositoryLabel->setText(StashDialog::msgRepositoryLabel(m_repository));
|
||||
QString errorMessage;
|
||||
if (!m_model->refresh(m_repository, &errorMessage))
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
|
||||
m_ui->branchView->expandAll();
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
|
||||
<< newFullName.last(),
|
||||
&output, &errorMessage)) {
|
||||
node->name = oldFullName.last();
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
|
||||
<< QLatin1String("-v") << QLatin1String("-a");
|
||||
QString output;
|
||||
if (!m_client->synchronousBranchCmd(workingDirectory, branchArgs, &output, errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(*errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(*errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName)
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory,
|
||||
QStringList() << QLatin1String("-m") << oldName << newName,
|
||||
&output, &errorMessage))
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
else
|
||||
refresh(m_workingDirectory, &errorMessage);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ void BranchModel::removeBranch(const QModelIndex &idx)
|
||||
|
||||
args << QLatin1String("-D") << branch;
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ void BranchModel::checkoutBranch(const QModelIndex &idx)
|
||||
case GitClient::StashCanceled:
|
||||
return;
|
||||
case GitClient::StashFailed:
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
return;
|
||||
}
|
||||
if (m_client->synchronousCheckoutBranch(m_workingDirectory, branch, &errorMessage)) {
|
||||
@@ -460,7 +460,7 @@ void BranchModel::checkoutBranch(const QModelIndex &idx)
|
||||
}
|
||||
}
|
||||
if (!errorMessage.isEmpty())
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
}
|
||||
|
||||
bool BranchModel::branchIsMerged(const QModelIndex &idx)
|
||||
@@ -475,7 +475,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
|
||||
|
||||
args << QLatin1String("-a") << QLatin1String("--contains") << sha(idx);
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ QModelIndex BranchModel::addBranch(const QString &branchName, bool track, const
|
||||
args << branchName << startPoint;
|
||||
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
CloneWizard::CloneWizard(QObject *parent) :
|
||||
VCSBase::BaseCheckoutWizard(parent)
|
||||
VcsBase::BaseCheckoutWizard(parent)
|
||||
{
|
||||
setId(QLatin1String(VCSBase::Constants::VCS_ID_GIT));
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
}
|
||||
|
||||
QIcon CloneWizard::icon() const
|
||||
@@ -72,19 +72,19 @@ QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path)
|
||||
QList<QWizardPage*> rc;
|
||||
const Internal::GitVersionControl *vc = Internal::GitPlugin::instance()->gitVersionControl();
|
||||
if (!vc->isConfigured())
|
||||
rc.append(new VCSBase::VcsConfigurationPage(vc));
|
||||
rc.append(new VcsBase::VcsConfigurationPage(vc));
|
||||
CloneWizardPage *cwp = new CloneWizardPage;
|
||||
cwp->setPath(path);
|
||||
rc.push_back(cwp);
|
||||
return rc;
|
||||
}
|
||||
|
||||
QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
QString *checkoutPath)
|
||||
{
|
||||
// Collect parameters for the clone command.
|
||||
const CloneWizardPage *cwp = qobject_cast<const CloneWizardPage *>(parameterPages.front());
|
||||
QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>())
|
||||
QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>())
|
||||
return cwp->createCheckoutJob(checkoutPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class CloneWizard : public VCSBase::BaseCheckoutWizard
|
||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
protected:
|
||||
// BaseCheckoutWizard
|
||||
virtual QList<QWizardPage*> createParameterPages(const QString &path);
|
||||
virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
virtual QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
QString *checkoutPath);
|
||||
};
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ bool CloneWizardPagePrivate::urlIsLocal(const QString &url)
|
||||
}
|
||||
|
||||
CloneWizardPage::CloneWizardPage(QWidget *parent) :
|
||||
VCSBase::BaseCheckoutWizardPage(parent),
|
||||
VcsBase::BaseCheckoutWizardPage(parent),
|
||||
d(new CloneWizardPagePrivate)
|
||||
{
|
||||
setTitle(tr("Location"));
|
||||
@@ -137,7 +137,7 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const
|
||||
return url;
|
||||
}
|
||||
|
||||
QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(QString *checkoutPath) const
|
||||
QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(QString *checkoutPath) const
|
||||
{
|
||||
const Internal::GitClient *client = Internal::GitPlugin::instance()->gitClient();
|
||||
const QString workingDirectory = path();
|
||||
@@ -146,7 +146,7 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(
|
||||
|
||||
const QString binary = client->gitBinaryPath();
|
||||
|
||||
VCSBase::ProcessCheckoutJob *job = new VCSBase::ProcessCheckoutJob;
|
||||
VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob;
|
||||
const QProcessEnvironment env = client->processEnvironment();
|
||||
|
||||
// 1) Basic checkout step
|
||||
@@ -176,7 +176,7 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(
|
||||
job->addStep(binary, args, *checkoutPath, env);
|
||||
}
|
||||
|
||||
return QSharedPointer<VCSBase::AbstractCheckoutJob>(job);
|
||||
return QSharedPointer<VcsBase::AbstractCheckoutJob>(job);
|
||||
}
|
||||
|
||||
QStringList CloneWizardPage::branches(const QString &repository, int *current)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
namespace VCSBase {
|
||||
namespace VcsBase {
|
||||
class AbstractCheckoutJob;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Git {
|
||||
struct CloneWizardPagePrivate;
|
||||
|
||||
// Used by gitorious as well.
|
||||
class CloneWizardPage : public VCSBase::BaseCheckoutWizardPage
|
||||
class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool deleteMasterBranch READ deleteMasterBranch WRITE setDeleteMasterBranch)
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
explicit CloneWizardPage(QWidget *parent = 0);
|
||||
virtual ~CloneWizardPage();
|
||||
|
||||
QSharedPointer<VCSBase::AbstractCheckoutJob> createCheckoutJob(QString *checkoutPath) const;
|
||||
QSharedPointer<VcsBase::AbstractCheckoutJob> createCheckoutJob(QString *checkoutPath) const;
|
||||
|
||||
protected:
|
||||
virtual QString directoryFromRepository(const QString &r) const;
|
||||
|
||||
@@ -82,7 +82,7 @@ static const char GIT_DIRECTORY[] = ".git";
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class BaseGitDiffArgumentsWidget : public VCSBase::VCSBaseEditorParameterWidget
|
||||
class BaseGitDiffArgumentsWidget : public VcsBase::VcsBaseEditorParameterWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -210,7 +210,7 @@ private:
|
||||
QString m_id;
|
||||
};
|
||||
|
||||
class GitBlameArgumentsWidget : public VCSBase::VCSBaseEditorParameterWidget
|
||||
class GitBlameArgumentsWidget : public VcsBase::VcsBaseEditorParameterWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
setBaseArguments(args);
|
||||
}
|
||||
|
||||
void setEditor(VCSBase::VCSBaseEditorWidget *editor)
|
||||
void setEditor(VcsBase::VcsBaseEditorWidget *editor)
|
||||
{
|
||||
Q_ASSERT(editor);
|
||||
m_editor = editor;
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
VCSBase::VCSBaseEditorWidget *m_editor;
|
||||
VcsBase::VcsBaseEditorWidget *m_editor;
|
||||
GitClient *m_client;
|
||||
QString m_workingDirectory;
|
||||
QString m_revision;
|
||||
@@ -322,9 +322,9 @@ static inline QStringList commandOutputLinesFromLocal8Bit(const QByteArray &a)
|
||||
return output.split(newLine);
|
||||
}
|
||||
|
||||
static inline VCSBase::VCSBaseOutputWindow *outputWindow()
|
||||
static inline VcsBase::VcsBaseOutputWindow *outputWindow()
|
||||
{
|
||||
return VCSBase::VCSBaseOutputWindow::instance();
|
||||
return VcsBase::VcsBaseOutputWindow::instance();
|
||||
}
|
||||
|
||||
static inline QString msgRepositoryNotFound(const QString &dir)
|
||||
@@ -363,13 +363,13 @@ QString GitClient::findRepositoryForDirectory(const QString &dir)
|
||||
{
|
||||
// Check for ".git/config"
|
||||
const QString checkFile = QLatin1String(GIT_DIRECTORY) + QLatin1String("/config");
|
||||
return VCSBase::VCSBasePlugin::findRepositoryForDirectory(dir, checkFile);
|
||||
return VcsBase::VcsBasePlugin::findRepositoryForDirectory(dir, checkFile);
|
||||
}
|
||||
|
||||
VCSBase::VCSBaseEditorWidget *GitClient::findExistingVCSEditor(const char *registerDynamicProperty,
|
||||
VcsBase::VcsBaseEditorWidget *GitClient::findExistingVCSEditor(const char *registerDynamicProperty,
|
||||
const QString &dynamicPropertyValue) const
|
||||
{
|
||||
VCSBase::VCSBaseEditorWidget *rc = 0;
|
||||
VcsBase::VcsBaseEditorWidget *rc = 0;
|
||||
Core::IEditor *outputEditor = locateEditor(m_core, registerDynamicProperty, dynamicPropertyValue);
|
||||
if (!outputEditor)
|
||||
return 0;
|
||||
@@ -377,7 +377,7 @@ VCSBase::VCSBaseEditorWidget *GitClient::findExistingVCSEditor(const char *regis
|
||||
// Exists already
|
||||
Core::EditorManager::instance()->activateEditor(outputEditor, Core::EditorManager::ModeSwitch);
|
||||
outputEditor->createNew(m_msgWait);
|
||||
rc = VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(outputEditor);
|
||||
rc = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -386,7 +386,7 @@ VCSBase::VCSBaseEditorWidget *GitClient::findExistingVCSEditor(const char *regis
|
||||
* (using the file's codec). Makes use of a dynamic property to find an
|
||||
* existing instance and to reuse it (in case, say, 'git diff foo' is
|
||||
* already open). */
|
||||
VCSBase::VCSBaseEditorWidget *GitClient::createVCSEditor(const Core::Id &id,
|
||||
VcsBase::VcsBaseEditorWidget *GitClient::createVcsEditor(const Core::Id &id,
|
||||
QString title,
|
||||
// Source file or directory
|
||||
const QString &source,
|
||||
@@ -396,19 +396,19 @@ VCSBase::VCSBaseEditorWidget *GitClient::createVCSEditor(const Core::Id &id,
|
||||
const QString &dynamicPropertyValue,
|
||||
QWidget *configWidget) const
|
||||
{
|
||||
VCSBase::VCSBaseEditorWidget *rc = 0;
|
||||
VcsBase::VcsBaseEditorWidget *rc = 0;
|
||||
Q_ASSERT(!findExistingVCSEditor(registerDynamicProperty, dynamicPropertyValue));
|
||||
|
||||
// Create new, set wait message, set up with source and codec
|
||||
Core::IEditor *outputEditor = m_core->editorManager()->openEditorWithContents(id, &title, m_msgWait);
|
||||
outputEditor->file()->setProperty(registerDynamicProperty, dynamicPropertyValue);
|
||||
rc = VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(outputEditor);
|
||||
rc = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor);
|
||||
connect(rc, SIGNAL(annotateRevisionRequested(QString,QString,int)),
|
||||
this, SLOT(slotBlameRevisionRequested(QString,QString,int)));
|
||||
QTC_ASSERT(rc, return 0);
|
||||
rc->setSource(source);
|
||||
if (codecType == CodecSource) {
|
||||
rc->setCodec(VCSBase::VCSBaseEditorWidget::getCodec(source));
|
||||
rc->setCodec(VcsBase::VcsBaseEditorWidget::getCodec(source));
|
||||
} else if (codecType == CodecLogOutput) {
|
||||
QString encodingName = readConfigValue(source, QLatin1String("i18n.logOutputEncoding"));
|
||||
if (encodingName.isEmpty())
|
||||
@@ -434,15 +434,15 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID;
|
||||
const QString title = tr("Git Diff");
|
||||
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", workingDirectory);
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", workingDirectory);
|
||||
if (!editor) {
|
||||
GitCommitDiffArgumentsWidget *argWidget =
|
||||
new GitCommitDiffArgumentsWidget(this, workingDirectory, diffArgs,
|
||||
unstagedFileNames, stagedFileNames);
|
||||
|
||||
editor = createVCSEditor(editorId, title,
|
||||
editor = createVcsEditor(editorId, title,
|
||||
workingDirectory, CodecSource, "originalFileName", workingDirectory, argWidget);
|
||||
connect(editor, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), argWidget, SLOT(executeCommand()));
|
||||
connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), argWidget, SLOT(executeCommand()));
|
||||
editor->setRevertDiffChunkEnabled(true);
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
// Create a batch of 2 commands to be run after each other in case
|
||||
// we have a mixture of staged/unstaged files as is the case
|
||||
// when using the submit dialog.
|
||||
VCSBase::Command *command = createCommand(workingDirectory, editor);
|
||||
VcsBase::Command *command = createCommand(workingDirectory, editor);
|
||||
// Directory diff?
|
||||
|
||||
QStringList cmdArgs;
|
||||
@@ -492,15 +492,15 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
{
|
||||
const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID;
|
||||
const QString title = tr("Git Diff \"%1\"").arg(fileName);
|
||||
const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, fileName);
|
||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileName);
|
||||
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", sourceFile);
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", sourceFile);
|
||||
if (!editor) {
|
||||
GitFileDiffArgumentsWidget *argWidget =
|
||||
new GitFileDiffArgumentsWidget(this, workingDirectory, diffArgs, fileName);
|
||||
|
||||
editor = createVCSEditor(editorId, title, sourceFile, CodecSource, "originalFileName", sourceFile, argWidget);
|
||||
connect(editor, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), argWidget, SLOT(executeCommand()));
|
||||
editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "originalFileName", sourceFile, argWidget);
|
||||
connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), argWidget, SLOT(executeCommand()));
|
||||
editor->setRevertDiffChunkEnabled(true);
|
||||
}
|
||||
|
||||
@@ -522,11 +522,11 @@ void GitClient::diffBranch(const QString &workingDirectory,
|
||||
{
|
||||
const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID;
|
||||
const QString title = tr("Git Diff Branch \"%1\"").arg(branchName);
|
||||
const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, QStringList());
|
||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, QStringList());
|
||||
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("BranchName", branchName);
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("BranchName", branchName);
|
||||
if (!editor)
|
||||
editor = createVCSEditor(editorId, title, sourceFile, CodecSource, "BranchName", branchName,
|
||||
editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "BranchName", branchName,
|
||||
new GitBranchDiffArgumentsWidget(this, workingDirectory,
|
||||
diffArgs, branchName));
|
||||
|
||||
@@ -545,9 +545,9 @@ void GitClient::status(const QString &workingDirectory)
|
||||
// @TODO: Use "--no-color" once it is supported
|
||||
QStringList statusArgs(QLatin1String("status"));
|
||||
statusArgs << QLatin1String("-u");
|
||||
VCSBase::VCSBaseOutputWindow *outwin = outputWindow();
|
||||
VcsBase::VcsBaseOutputWindow *outwin = outputWindow();
|
||||
outwin->setRepository(workingDirectory);
|
||||
VCSBase::Command *command = executeGit(workingDirectory, statusArgs, 0, true);
|
||||
VcsBase::Command *command = executeGit(workingDirectory, statusArgs, 0, true);
|
||||
connect(command, SIGNAL(finished(bool,int,QVariant)), outwin, SLOT(clearRepository()),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
@@ -574,10 +574,10 @@ void GitClient::graphLog(const QString &workingDirectory, const QString & branch
|
||||
arguments << branch;
|
||||
}
|
||||
const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
||||
const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, QStringList());
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile);
|
||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, QStringList());
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile);
|
||||
if (!editor)
|
||||
editor = createVCSEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile, 0);
|
||||
editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile, 0);
|
||||
executeGit(workingDirectory, arguments, editor);
|
||||
}
|
||||
|
||||
@@ -588,10 +588,10 @@ void GitClient::log(const QString &workingDirectory, const QStringList &fileName
|
||||
fileNames.join(QString(", "));
|
||||
const QString title = tr("Git Log \"%1\"").arg(msgArg);
|
||||
const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
||||
const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, fileNames);
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile);
|
||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileNames);
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile);
|
||||
if (!editor)
|
||||
editor = createVCSEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile,
|
||||
editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile,
|
||||
new GitLogArgumentsWidget(this, workingDirectory,
|
||||
enableAnnotationContextMenu,
|
||||
args, fileNames));
|
||||
@@ -640,9 +640,9 @@ void GitClient::show(const QString &source, const QString &id, const QStringList
|
||||
|
||||
const QString title = tr("Git Show \"%1\"").arg(id);
|
||||
const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID;
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("show", id);
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("show", id);
|
||||
if (!editor)
|
||||
editor = createVCSEditor(editorId, title, source, CodecSource, "show", id,
|
||||
editor = createVcsEditor(editorId, title, source, CodecSource, "show", id,
|
||||
new GitShowArgumentsWidget(this, source, args, id));
|
||||
|
||||
GitShowArgumentsWidget *argWidget = qobject_cast<GitShowArgumentsWidget *>(editor->configurationWidget());
|
||||
@@ -682,16 +682,16 @@ void GitClient::blame(const QString &workingDirectory,
|
||||
int lineNumber)
|
||||
{
|
||||
const Core::Id editorId = Git::Constants::GIT_BLAME_EDITOR_ID;
|
||||
const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDirectory, QStringList(fileName), revision);
|
||||
const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDirectory, QStringList(fileName), revision);
|
||||
const QString title = tr("Git Blame \"%1\"").arg(id);
|
||||
const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, fileName);
|
||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileName);
|
||||
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("blameFileName", id);
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("blameFileName", id);
|
||||
if (!editor) {
|
||||
GitBlameArgumentsWidget *argWidget =
|
||||
new GitBlameArgumentsWidget(this, workingDirectory, args,
|
||||
revision, fileName);
|
||||
editor = createVCSEditor(editorId, title, sourceFile, CodecSource, "blameFileName", id, argWidget);
|
||||
editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "blameFileName", id, argWidget);
|
||||
argWidget->setEditor(editor);
|
||||
}
|
||||
|
||||
@@ -704,14 +704,14 @@ void GitClient::blame(const QString &workingDirectory,
|
||||
arguments << QLatin1String("--") << fileName;
|
||||
if (!revision.isEmpty())
|
||||
arguments << revision;
|
||||
executeGit(workingDirectory, arguments, editor, false, VCSBase::Command::NoReport, lineNumber);
|
||||
executeGit(workingDirectory, arguments, editor, false, VcsBase::Command::NoReport, lineNumber);
|
||||
}
|
||||
|
||||
void GitClient::checkoutBranch(const QString &workingDirectory, const QString &branch)
|
||||
{
|
||||
QStringList arguments(QLatin1String("checkout"));
|
||||
arguments << branch;
|
||||
VCSBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true);
|
||||
VcsBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true);
|
||||
connectRepositoryChanged(workingDirectory, cmd);
|
||||
}
|
||||
|
||||
@@ -761,7 +761,7 @@ void GitClient::hardReset(const QString &workingDirectory, const QString &commit
|
||||
if (!commit.isEmpty())
|
||||
arguments << commit;
|
||||
|
||||
VCSBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true);
|
||||
VcsBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true);
|
||||
connectRepositoryChanged(workingDirectory, cmd);
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ bool GitClient::synchronousInit(const QString &workingDirectory)
|
||||
if (!rc)
|
||||
outputWindow()->appendError(commandOutputFromLocal8Bit(errorText));
|
||||
else {
|
||||
// TODO: Turn this into a VCSBaseClient and use resetCachedVcsInfo(...)
|
||||
// TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...)
|
||||
Core::VcsManager *vcsManager = m_core->vcsManager();
|
||||
vcsManager->resetVersionControlForDirectory(workingDirectory);
|
||||
}
|
||||
@@ -1314,12 +1314,12 @@ bool GitClient::synchronousApplyPatch(const QString &workingDirectory,
|
||||
}
|
||||
|
||||
// Factory function to create an asynchronous command
|
||||
VCSBase::Command *GitClient::createCommand(const QString &workingDirectory,
|
||||
VCSBase::VCSBaseEditorWidget* editor,
|
||||
VcsBase::Command *GitClient::createCommand(const QString &workingDirectory,
|
||||
VcsBase::VcsBaseEditorWidget* editor,
|
||||
bool useOutputToWindow,
|
||||
int editorLineNumber)
|
||||
{
|
||||
VCSBase::Command *command = new VCSBase::Command(gitBinaryPath(), workingDirectory, processEnvironment());
|
||||
VcsBase::Command *command = new VcsBase::Command(gitBinaryPath(), workingDirectory, processEnvironment());
|
||||
command->setCookie(QVariant(editorLineNumber));
|
||||
if (editor)
|
||||
connect(command, SIGNAL(finished(bool,int,QVariant)), editor, SLOT(commandFinishedGotoLine(bool,int,QVariant)));
|
||||
@@ -1339,16 +1339,16 @@ VCSBase::Command *GitClient::createCommand(const QString &workingDirectory,
|
||||
}
|
||||
|
||||
// Execute a single command
|
||||
VCSBase::Command *GitClient::executeGit(const QString &workingDirectory,
|
||||
VcsBase::Command *GitClient::executeGit(const QString &workingDirectory,
|
||||
const QStringList &arguments,
|
||||
VCSBase::VCSBaseEditorWidget* editor,
|
||||
VcsBase::VcsBaseEditorWidget* editor,
|
||||
bool useOutputToWindow,
|
||||
VCSBase::Command::TerminationReportMode tm,
|
||||
VcsBase::Command::TerminationReportMode tm,
|
||||
int editorLineNumber,
|
||||
bool unixTerminalDisabled)
|
||||
{
|
||||
outputWindow()->appendCommand(workingDirectory, settings()->stringValue(GitSettings::binaryPathKey), arguments);
|
||||
VCSBase::Command *command = createCommand(workingDirectory, editor, useOutputToWindow, editorLineNumber);
|
||||
VcsBase::Command *command = createCommand(workingDirectory, editor, useOutputToWindow, editorLineNumber);
|
||||
command->addJob(arguments, settings()->intValue(GitSettings::timeoutKey));
|
||||
command->setTerminationReportMode(tm);
|
||||
command->setUnixTerminalDisabled(unixTerminalDisabled);
|
||||
@@ -1367,7 +1367,7 @@ QProcessEnvironment GitClient::processEnvironment() const
|
||||
environment.insert(QLatin1String("HOME"), QDir::toNativeSeparators(QDir::homePath()));
|
||||
#endif // Q_OS_WIN
|
||||
// Set up SSH and C locale (required by git using perl).
|
||||
VCSBase::VCSBasePlugin::setProcessEnvironment(&environment, false);
|
||||
VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false);
|
||||
return environment;
|
||||
}
|
||||
|
||||
@@ -1378,7 +1378,7 @@ Utils::SynchronousProcessResponse GitClient::synchronousGit(const QString &worki
|
||||
unsigned flags,
|
||||
QTextCodec *stdOutCodec)
|
||||
{
|
||||
return VCSBase::VCSBasePlugin::runVCS(workingDirectory, gitBinaryPath(), gitArguments,
|
||||
return VcsBase::VcsBasePlugin::runVcs(workingDirectory, gitBinaryPath(), gitArguments,
|
||||
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
||||
processEnvironment(),
|
||||
flags, stdOutCodec);
|
||||
@@ -1390,7 +1390,7 @@ bool GitClient::fullySynchronousGit(const QString &workingDirectory,
|
||||
QByteArray* errorText,
|
||||
bool logCommandToWindow) const
|
||||
{
|
||||
return VCSBase::VCSBasePlugin::runFullySynchronous(workingDirectory, gitBinaryPath(), gitArguments,
|
||||
return VcsBase::VcsBasePlugin::runFullySynchronous(workingDirectory, gitBinaryPath(), gitArguments,
|
||||
processEnvironment(), outputText, errorText,
|
||||
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
||||
logCommandToWindow);
|
||||
@@ -1506,9 +1506,9 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
||||
QStringList arguments(QLatin1String("ls-remote"));
|
||||
arguments << repositoryURL << QLatin1String("HEAD") << QLatin1String("refs/heads/*");
|
||||
const unsigned flags =
|
||||
VCSBase::VCSBasePlugin::SshPasswordPrompt|
|
||||
VCSBase::VCSBasePlugin::SuppressStdErrInLogWindow|
|
||||
VCSBase::VCSBasePlugin::SuppressFailMessageInLogWindow;
|
||||
VcsBase::VcsBasePlugin::SshPasswordPrompt|
|
||||
VcsBase::VcsBasePlugin::SuppressStdErrInLogWindow|
|
||||
VcsBase::VcsBasePlugin::SuppressFailMessageInLogWindow;
|
||||
const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
|
||||
QStringList branches;
|
||||
branches << "<detached HEAD>";
|
||||
@@ -1564,7 +1564,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
||||
const QString binary = gitBinDirectory + QLatin1String("/gitk");
|
||||
QStringList arguments;
|
||||
#endif
|
||||
VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance();
|
||||
VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance();
|
||||
const QString gitkOpts = settings()->stringValue(GitSettings::gitkOptionsKey);
|
||||
if (!gitkOpts.isEmpty())
|
||||
arguments.append(Utils::QtcProcess::splitArgs(gitkOpts));
|
||||
@@ -1667,7 +1667,7 @@ bool GitClient::getCommitData(const QString &workingDirectory,
|
||||
// Filter out untracked files that are not part of the project
|
||||
QStringList untrackedFiles = commitData->filterFiles(CommitData::UntrackedFile);
|
||||
|
||||
VCSBase::VCSBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &untrackedFiles);
|
||||
VcsBase::VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &untrackedFiles);
|
||||
QList<CommitData::StateFilePair> filteredFiles;
|
||||
QList<CommitData::StateFilePair>::const_iterator it = commitData->files.constBegin();
|
||||
for ( ; it != commitData->files.constEnd(); ++it) {
|
||||
@@ -1736,7 +1736,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
||||
const GitSubmitEditorPanelData &data,
|
||||
const QString &amendSHA1,
|
||||
const QString &messageFile,
|
||||
VCSBase::SubmitFileModel *model)
|
||||
VcsBase::SubmitFileModel *model)
|
||||
{
|
||||
const QString renameSeparator = QLatin1String(" -> ");
|
||||
const bool amend = !amendSHA1.isEmpty();
|
||||
@@ -1827,7 +1827,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
||||
* files) or a single directory (revert all). Qt Creator currently has only
|
||||
* 'revert single' in its VCS menus, but the code is prepared to deal with
|
||||
* reverting a directory pending a sophisticated selection dialog in the
|
||||
* VCSBase plugin. */
|
||||
* VcsBase plugin. */
|
||||
GitClient::RevertResult GitClient::revertI(QStringList files,
|
||||
bool *ptrToIsDirectory,
|
||||
QString *errorMessage,
|
||||
@@ -1938,8 +1938,8 @@ bool GitClient::synchronousFetch(const QString &workingDirectory, const QString
|
||||
if (!remote.isEmpty())
|
||||
arguments << remote;
|
||||
// Disable UNIX terminals to suppress SSH prompting.
|
||||
const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow
|
||||
|VCSBase::VCSBasePlugin::ShowSuccessMessage;
|
||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow
|
||||
|VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
||||
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags);
|
||||
return resp.result == Utils::SynchronousProcessResponse::Finished;
|
||||
}
|
||||
@@ -1955,7 +1955,7 @@ bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
|
||||
if (rebase)
|
||||
arguments << QLatin1String("--rebase");
|
||||
// Disable UNIX terminals to suppress SSH prompting.
|
||||
const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow;
|
||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow;
|
||||
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags);
|
||||
// Notify about changed files or abort the rebase.
|
||||
const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished;
|
||||
@@ -1971,7 +1971,7 @@ bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
|
||||
void GitClient::syncAbortPullRebase(const QString &workingDir)
|
||||
{
|
||||
// Abort rebase to clean if something goes wrong
|
||||
VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance();
|
||||
VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance();
|
||||
outwin->appendError(tr("The command 'git pull --rebase' failed, aborting rebase."));
|
||||
QStringList arguments;
|
||||
arguments << QLatin1String("rebase") << QLatin1String("--abort");
|
||||
@@ -1989,8 +1989,8 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory)
|
||||
QStringList args;
|
||||
args << QLatin1String("svn") << QLatin1String("fetch");
|
||||
// Disable UNIX terminals to suppress SSH prompting.
|
||||
const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow
|
||||
|VCSBase::VCSBasePlugin::ShowSuccessMessage;
|
||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow
|
||||
|VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
||||
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, args, flags);
|
||||
// Notify about changes.
|
||||
if (resp.result == Utils::SynchronousProcessResponse::Finished)
|
||||
@@ -2008,18 +2008,18 @@ void GitClient::subversionLog(const QString &workingDirectory)
|
||||
// Create a command editor, no highlighting or interaction.
|
||||
const QString title = tr("Git SVN Log");
|
||||
const Core::Id editorId = Git::Constants::C_GIT_COMMAND_LOG_EDITOR;
|
||||
const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, QStringList());
|
||||
VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile);
|
||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, QStringList());
|
||||
VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile);
|
||||
if (!editor)
|
||||
editor = createVCSEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile, 0);
|
||||
editor = createVcsEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile, 0);
|
||||
executeGit(workingDirectory, arguments, editor);
|
||||
}
|
||||
|
||||
bool GitClient::synchronousPush(const QString &workingDirectory, const QString &remote)
|
||||
{
|
||||
// Disable UNIX terminals to suppress SSH prompting.
|
||||
const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow
|
||||
|VCSBase::VCSBasePlugin::ShowSuccessMessage;
|
||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow
|
||||
|VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
||||
QStringList arguments(QLatin1String("push"));
|
||||
if (!remote.isEmpty())
|
||||
arguments << remote;
|
||||
@@ -2037,7 +2037,7 @@ void GitClient::stashPop(const QString &workingDirectory)
|
||||
{
|
||||
QStringList arguments(QLatin1String("stash"));
|
||||
arguments << QLatin1String("pop");
|
||||
VCSBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true);
|
||||
VcsBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true);
|
||||
connectRepositoryChanged(workingDirectory, cmd);
|
||||
}
|
||||
|
||||
@@ -2171,9 +2171,9 @@ QString GitClient::readConfigValue(const QString &workingDirectory, const QStrin
|
||||
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
|
||||
{
|
||||
QDir workingDirectory(directory);
|
||||
const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt |
|
||||
VCSBase::VCSBasePlugin::ShowStdOutInLogWindow|
|
||||
VCSBase::VCSBasePlugin::ShowSuccessMessage;
|
||||
const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt |
|
||||
VcsBase::VcsBasePlugin::ShowStdOutInLogWindow|
|
||||
VcsBase::VcsBasePlugin::ShowSuccessMessage;
|
||||
|
||||
if (workingDirectory.exists()) {
|
||||
if (!synchronousInit(workingDirectory.path()))
|
||||
@@ -2212,7 +2212,7 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
|
||||
workingDirectory.cdUp();
|
||||
const Utils::SynchronousProcessResponse resp =
|
||||
synchronousGit(workingDirectory.path(), arguments, flags);
|
||||
// TODO: Turn this into a VCSBaseClient and use resetCachedVcsInfo(...)
|
||||
// TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...)
|
||||
Core::VcsManager *vcsManager = m_core->vcsManager();
|
||||
vcsManager->resetVersionControlForDirectory(workingDirectory.absolutePath());
|
||||
return (resp.result == Utils::SynchronousProcessResponse::Finished);
|
||||
@@ -2236,7 +2236,7 @@ GitSettings *GitClient::settings() const
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
void GitClient::connectRepositoryChanged(const QString & repository, VCSBase::Command *cmd)
|
||||
void GitClient::connectRepositoryChanged(const QString & repository, VcsBase::Command *cmd)
|
||||
{
|
||||
// Bind command success termination with repository to changed signal
|
||||
if (!m_repositoryChangedSignalMapper) {
|
||||
|
||||
@@ -55,8 +55,8 @@ namespace Core {
|
||||
class ICore;
|
||||
}
|
||||
|
||||
namespace VCSBase {
|
||||
class VCSBaseEditorWidget;
|
||||
namespace VcsBase {
|
||||
class VcsBaseEditorWidget;
|
||||
class SubmitFileModel;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
const GitSubmitEditorPanelData &data,
|
||||
const QString &amendSHA1,
|
||||
const QString &messageFile,
|
||||
VCSBase::SubmitFileModel *model);
|
||||
VcsBase::SubmitFileModel *model);
|
||||
|
||||
enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed };
|
||||
StatusResult gitStatus(const QString &workingDirectory,
|
||||
@@ -233,10 +233,10 @@ private slots:
|
||||
void slotBlameRevisionRequested(const QString &source, QString change, int lineNumber);
|
||||
|
||||
private:
|
||||
VCSBase::VCSBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty,
|
||||
VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty,
|
||||
const QString &dynamicPropertyValue) const;
|
||||
enum CodecType { CodecSource, CodecLogOutput, CodecNone };
|
||||
VCSBase::VCSBaseEditorWidget *createVCSEditor(const Core::Id &kind,
|
||||
VcsBase::VcsBaseEditorWidget *createVcsEditor(const Core::Id &kind,
|
||||
QString title,
|
||||
const QString &source,
|
||||
CodecType codecType,
|
||||
@@ -244,16 +244,16 @@ private:
|
||||
const QString &dynamicPropertyValue,
|
||||
QWidget *configWidget) const;
|
||||
|
||||
VCSBase::Command *createCommand(const QString &workingDirectory,
|
||||
VCSBase::VCSBaseEditorWidget* editor = 0,
|
||||
VcsBase::Command *createCommand(const QString &workingDirectory,
|
||||
VcsBase::VcsBaseEditorWidget* editor = 0,
|
||||
bool useOutputToWindow = false,
|
||||
int editorLineNumber = -1);
|
||||
|
||||
VCSBase::Command *executeGit(const QString &workingDirectory,
|
||||
VcsBase::Command *executeGit(const QString &workingDirectory,
|
||||
const QStringList &arguments,
|
||||
VCSBase::VCSBaseEditorWidget* editor = 0,
|
||||
VcsBase::VcsBaseEditorWidget* editor = 0,
|
||||
bool useOutputToWindow = false,
|
||||
VCSBase::Command::TerminationReportMode tm = VCSBase::Command::NoReport,
|
||||
VcsBase::Command::TerminationReportMode tm = VcsBase::Command::NoReport,
|
||||
int editorLineNumber = -1,
|
||||
bool unixTerminalDisabled = false);
|
||||
|
||||
@@ -265,7 +265,7 @@ private:
|
||||
bool logCommandToWindow = true) const;
|
||||
|
||||
// Synchronous git execution using Utils::SynchronousProcess, with
|
||||
// log windows updating (using VCSBasePlugin::runVCS with flags).
|
||||
// log windows updating (using VcsBasePlugin::runVcs with flags).
|
||||
inline Utils::SynchronousProcessResponse
|
||||
synchronousGit(const QString &workingDirectory, const QStringList &arguments,
|
||||
unsigned flags = 0, QTextCodec *outputCodec = 0);
|
||||
@@ -278,7 +278,7 @@ private:
|
||||
bool *isDirectory,
|
||||
QString *errorMessage,
|
||||
bool revertStaging);
|
||||
void connectRepositoryChanged(const QString & repository, VCSBase::Command *cmd);
|
||||
void connectRepositoryChanged(const QString & repository, VcsBase::Command *cmd);
|
||||
bool synchronousPull(const QString &workingDirectory, bool rebase);
|
||||
void syncAbortPullRebase(const QString &workingDir);
|
||||
bool tryLauchingGitK(const QProcessEnvironment &env,
|
||||
|
||||
@@ -61,9 +61,9 @@ namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
// ------------ GitEditor
|
||||
GitEditor::GitEditor(const VCSBase::VCSBaseEditorParameters *type,
|
||||
GitEditor::GitEditor(const VcsBase::VcsBaseEditorParameters *type,
|
||||
QWidget *parent) :
|
||||
VCSBase::VCSBaseEditorWidget(type, parent),
|
||||
VcsBase::VcsBaseEditorWidget(type, parent),
|
||||
m_changeNumberPattern8(QLatin1String(CHANGE_PATTERN_8C)),
|
||||
m_changeNumberPattern40(QLatin1String(CHANGE_PATTERN_40C))
|
||||
{
|
||||
@@ -110,13 +110,13 @@ QString GitEditor::changeUnderCursor(const QTextCursor &c) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
VCSBase::DiffHighlighter *GitEditor::createDiffHighlighter() const
|
||||
VcsBase::DiffHighlighter *GitEditor::createDiffHighlighter() const
|
||||
{
|
||||
const QRegExp filePattern(QLatin1String("^(diff --git a/|index |[+-][+-][+-] [ab]).*$"));
|
||||
return new VCSBase::DiffHighlighter(filePattern);
|
||||
return new VcsBase::DiffHighlighter(filePattern);
|
||||
}
|
||||
|
||||
VCSBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
|
||||
VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
|
||||
{
|
||||
return new GitAnnotationHighlighter(changes);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void GitEditor::setPlainTextDataFiltered(const QByteArray &a)
|
||||
{
|
||||
QByteArray array = a;
|
||||
// If desired, filter out the date from annotation
|
||||
const bool omitAnnotationDate = contentType() == VCSBase::AnnotateOutput
|
||||
const bool omitAnnotationDate = contentType() == VcsBase::AnnotateOutput
|
||||
&& GitPlugin::instance()->settings().boolValue(GitSettings::omitAnnotationDateKey);
|
||||
if (omitAnnotationDate)
|
||||
array = removeAnnotationDate(a);
|
||||
@@ -222,13 +222,13 @@ QStringList GitEditor::annotationPreviousVersions(const QString &revision) const
|
||||
// Get the SHA1's of the file.
|
||||
if (!client->synchronousParentRevisions(workingDirectory, QStringList(fi.fileName()),
|
||||
revision, &revisions, &errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendSilently(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendSilently(errorMessage);
|
||||
return QStringList();
|
||||
}
|
||||
// Format verbose, SHA1 being first token
|
||||
QStringList descriptions;
|
||||
if (!client->synchronousShortDescriptions(workingDirectory, revisions, &descriptions, &errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendSilently(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendSilently(errorMessage);
|
||||
return QStringList();
|
||||
}
|
||||
return descriptions;
|
||||
|
||||
@@ -44,12 +44,12 @@ QT_END_NAMESPACE
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class GitEditor : public VCSBase::VCSBaseEditorWidget
|
||||
class GitEditor : public VcsBase::VcsBaseEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GitEditor(const VCSBase::VCSBaseEditorParameters *type,
|
||||
explicit GitEditor(const VcsBase::VcsBaseEditorParameters *type,
|
||||
QWidget *parent);
|
||||
|
||||
public slots:
|
||||
@@ -60,8 +60,8 @@ public slots:
|
||||
private:
|
||||
virtual QSet<QString> annotationChanges() const;
|
||||
virtual QString changeUnderCursor(const QTextCursor &) const;
|
||||
virtual VCSBase::DiffHighlighter *createDiffHighlighter() const;
|
||||
virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
|
||||
virtual VcsBase::DiffHighlighter *createDiffHighlighter() const;
|
||||
virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
|
||||
virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const;
|
||||
virtual QStringList annotationPreviousVersions(const QString &revision) const;
|
||||
|
||||
|
||||
@@ -75,9 +75,9 @@ void GitoriousCloneWizardPage::initializePage()
|
||||
|
||||
// -------- GitoriousCloneWizard
|
||||
GitoriousCloneWizard::GitoriousCloneWizard(QObject *parent) :
|
||||
VCSBase::BaseCheckoutWizard(parent)
|
||||
VcsBase::BaseCheckoutWizard(parent)
|
||||
{
|
||||
setId(QLatin1String(VCSBase::Constants::VCS_ID_GIT));
|
||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||
}
|
||||
|
||||
QIcon GitoriousCloneWizard::icon() const
|
||||
@@ -100,7 +100,7 @@ QList<QWizardPage*> GitoriousCloneWizard::createParameterPages(const QString &pa
|
||||
QList<QWizardPage*> rc;
|
||||
const Core::IVersionControl *vc = Git::Internal::GitPlugin::instance()->versionControl();
|
||||
if (!vc->isConfigured())
|
||||
rc.append(new VCSBase::VcsConfigurationPage(vc));
|
||||
rc.append(new VcsBase::VcsConfigurationPage(vc));
|
||||
|
||||
GitoriousHostWizardPage *hostPage = new GitoriousHostWizardPage;
|
||||
GitoriousProjectWizardPage *projectPage = new GitoriousProjectWizardPage(hostPage);
|
||||
@@ -112,11 +112,11 @@ QList<QWizardPage*> GitoriousCloneWizard::createParameterPages(const QString &pa
|
||||
return rc;
|
||||
}
|
||||
|
||||
QSharedPointer<VCSBase::AbstractCheckoutJob> GitoriousCloneWizard::createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
QSharedPointer<VcsBase::AbstractCheckoutJob> GitoriousCloneWizard::createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
QString *checkoutPath)
|
||||
{
|
||||
const Git::CloneWizardPage *cwp = qobject_cast<const Git::CloneWizardPage *>(parameterPages.back());
|
||||
QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>())
|
||||
QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>())
|
||||
return cwp->createCheckoutJob(checkoutPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Internal {
|
||||
|
||||
// GitoriousCloneWizard: A wizard allowing for browsing
|
||||
// Gitorious-hosted projects.
|
||||
class GitoriousCloneWizard : public VCSBase::BaseCheckoutWizard
|
||||
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
protected:
|
||||
// BaseCheckoutWizard
|
||||
virtual QList<QWizardPage*> createParameterPages(const QString &path);
|
||||
virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
virtual QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages,
|
||||
QString *checkoutPath);
|
||||
};
|
||||
|
||||
|
||||
@@ -82,27 +82,27 @@
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
static const VcsBase::VcsBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
VCSBase::RegularCommandOutput,
|
||||
VcsBase::RegularCommandOutput,
|
||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_ID,
|
||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME,
|
||||
Git::Constants::C_GIT_COMMAND_LOG_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_commandlog",
|
||||
"gitlog"},
|
||||
{ VCSBase::LogOutput,
|
||||
{ VcsBase::LogOutput,
|
||||
Git::Constants::GIT_LOG_EDITOR_ID,
|
||||
Git::Constants::GIT_LOG_EDITOR_DISPLAY_NAME,
|
||||
Git::Constants::C_GIT_LOG_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_filelog",
|
||||
"gitfilelog"},
|
||||
{ VCSBase::AnnotateOutput,
|
||||
{ VcsBase::AnnotateOutput,
|
||||
Git::Constants::GIT_BLAME_EDITOR_ID,
|
||||
Git::Constants::GIT_BLAME_EDITOR_DISPLAY_NAME,
|
||||
Git::Constants::C_GIT_BLAME_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_annotation",
|
||||
"gitsannotate"},
|
||||
{ VCSBase::DiffOutput,
|
||||
{ VcsBase::DiffOutput,
|
||||
Git::Constants::GIT_DIFF_EDITOR_ID,
|
||||
Git::Constants::GIT_DIFF_EDITOR_DISPLAY_NAME,
|
||||
Git::Constants::C_GIT_DIFF_EDITOR,
|
||||
@@ -110,10 +110,10 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
};
|
||||
|
||||
// Utility to find a parameter set by type
|
||||
static inline const VCSBase::VCSBaseEditorParameters *findType(int ie)
|
||||
static inline const VcsBase::VcsBaseEditorParameters *findType(int ie)
|
||||
{
|
||||
const VCSBase::EditorContentType et = static_cast<VCSBase::EditorContentType>(ie);
|
||||
return VCSBase::VCSBaseEditorWidget::findType(editorParameters, sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters), et);
|
||||
const VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie);
|
||||
return VcsBase::VcsBaseEditorWidget::findType(editorParameters, sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et);
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(Git::Internal::GitClientMemberFunc)
|
||||
@@ -126,7 +126,7 @@ using namespace Git::Internal;
|
||||
GitPlugin *GitPlugin::m_instance = 0;
|
||||
|
||||
GitPlugin::GitPlugin() :
|
||||
VCSBase::VCSBasePlugin(QLatin1String(Git::Constants::GITSUBMITEDITOR_ID)),
|
||||
VcsBase::VcsBasePlugin(QLatin1String(Git::Constants::GITSUBMITEDITOR_ID)),
|
||||
m_core(0),
|
||||
m_commandLocator(0),
|
||||
m_showAction(0),
|
||||
@@ -173,7 +173,7 @@ GitPlugin *GitPlugin::instance()
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
|
||||
static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = {
|
||||
Git::Constants::SUBMIT_MIMETYPE,
|
||||
Git::Constants::GITSUBMITEDITOR_ID,
|
||||
Git::Constants::GITSUBMITEDITOR_DISPLAY_NAME,
|
||||
@@ -286,8 +286,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
m_gitClient = new GitClient(&m_settings);
|
||||
|
||||
typedef VCSBase::VCSEditorFactory<GitEditor> GitEditorFactory;
|
||||
typedef VCSBase::VCSSubmitEditorFactory<GitSubmitEditor> GitSubmitEditorFactory;
|
||||
typedef VcsBase::VcsEditorFactory<GitEditor> GitEditorFactory;
|
||||
typedef VcsBase::VcsSubmitEditorFactory<GitSubmitEditor> GitSubmitEditorFactory;
|
||||
|
||||
initializeVcs(new GitVersionControl(m_gitClient));
|
||||
|
||||
@@ -298,7 +298,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
addAutoReleasedObject(new SettingsPage());
|
||||
|
||||
static const char *describeSlot = SLOT(show(QString,QString));
|
||||
const int editorCount = sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters);
|
||||
const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters);
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new GitEditorFactory(editorParameters + i, m_gitClient, describeSlot));
|
||||
|
||||
@@ -549,12 +549,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
// Submit editor
|
||||
Core::Context submitContext(Constants::C_GITSUBMITEDITOR);
|
||||
m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
m_submitCurrentAction = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
Core::Command *command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
||||
|
||||
m_diffSelectedFilesAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||
m_diffSelectedFilesAction = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
|
||||
command = actionManager->registerAction(m_diffSelectedFilesAction, Constants::DIFF_SELECTED, submitContext);
|
||||
|
||||
m_undoAction = new QAction(tr("&Undo"), this);
|
||||
@@ -578,50 +578,50 @@ void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList
|
||||
|
||||
void GitPlugin::diffCurrentFile()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
m_gitClient->diff(state.currentFileTopLevel(), QStringList(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void GitPlugin::diffCurrentProject()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasProject(), return)
|
||||
m_gitClient->diff(state.currentProjectTopLevel(), QStringList(), state.relativeCurrentProject());
|
||||
}
|
||||
|
||||
void GitPlugin::diffRepository()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
m_gitClient->diff(state.topLevel(), QStringList(), QStringList());
|
||||
}
|
||||
|
||||
void GitPlugin::logFile()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
m_gitClient->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
|
||||
}
|
||||
|
||||
void GitPlugin::blameFile()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
const int lineNumber = VCSBase::VCSBaseEditorWidget::lineNumberOfCurrentEditor(state.currentFile());
|
||||
const int lineNumber = VcsBase::VcsBaseEditorWidget::lineNumberOfCurrentEditor(state.currentFile());
|
||||
m_gitClient->blame(state.currentFileTopLevel(), QStringList(), state.relativeCurrentFile(), QString(), lineNumber);
|
||||
}
|
||||
|
||||
void GitPlugin::logProject()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasProject(), return)
|
||||
m_gitClient->log(state.currentProjectTopLevel(), state.relativeCurrentProject());
|
||||
}
|
||||
|
||||
void GitPlugin::undoFileChanges(bool revertStaging)
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
Core::FileChangeBlocker fcb(state.currentFile());
|
||||
m_gitClient->revert(QStringList(state.currentFile()), revertStaging);
|
||||
@@ -634,7 +634,7 @@ void GitPlugin::undoUnstagedFileChanges()
|
||||
|
||||
void GitPlugin::undoRepositoryChanges()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
const QString msg = tr("Undo all pending changes to the repository\n%1?").arg(QDir::toNativeSeparators(state.topLevel()));
|
||||
const QMessageBox::StandardButton answer
|
||||
@@ -649,14 +649,14 @@ void GitPlugin::undoRepositoryChanges()
|
||||
|
||||
void GitPlugin::stageFile()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
m_gitClient->addFile(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void GitPlugin::unstageFile()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return)
|
||||
m_gitClient->synchronousReset(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
|
||||
}
|
||||
@@ -673,20 +673,20 @@ void GitPlugin::startCommit()
|
||||
|
||||
void GitPlugin::startCommit(bool amend)
|
||||
{
|
||||
if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor())
|
||||
if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor())
|
||||
return;
|
||||
if (isCommitEditorOpen()) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently being executed."));
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently being executed."));
|
||||
return;
|
||||
}
|
||||
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
|
||||
QString errorMessage, commitTemplate;
|
||||
CommitData data;
|
||||
if (!m_gitClient->getCommitData(state.topLevel(), amend, &commitTemplate, &data, &errorMessage)) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->append(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->append(errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@ void GitPlugin::startCommit(bool amend)
|
||||
saver.setAutoRemove(false);
|
||||
saver.write(commitTemplate.toLocal8Bit());
|
||||
if (!saver.finalize()) {
|
||||
VCSBase::VCSBaseOutputWindow::instance()->append(saver.errorString());
|
||||
VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString());
|
||||
return;
|
||||
}
|
||||
m_commitMessageFileName = saver.fileName();
|
||||
@@ -736,7 +736,7 @@ void GitPlugin::submitCurrentLog()
|
||||
m_core->editorManager()->closeEditors(editors);
|
||||
}
|
||||
|
||||
bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor)
|
||||
bool GitPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor)
|
||||
{
|
||||
if (!isCommitEditorOpen())
|
||||
return false;
|
||||
@@ -754,16 +754,16 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
|
||||
// Prompt user. Force a prompt unless submit was actually invoked (that
|
||||
// is, the editor was closed or shutdown).
|
||||
bool *promptData = m_settings.boolPointer(GitSettings::promptOnSubmitKey);
|
||||
const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer =
|
||||
const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer =
|
||||
editor->promptSubmit(tr("Closing Git Editor"),
|
||||
tr("Do you want to commit the change?"),
|
||||
tr("Git will not accept this commit. Do you want to continue to edit it?"),
|
||||
promptData, !m_submitActionTriggered, false);
|
||||
m_submitActionTriggered = false;
|
||||
switch (answer) {
|
||||
case VCSBase::VCSBaseSubmitEditor::SubmitCanceled:
|
||||
case VcsBase::VcsBaseSubmitEditor::SubmitCanceled:
|
||||
return false; // Keep editing and change file
|
||||
case VCSBase::VCSBaseSubmitEditor::SubmitDiscarded:
|
||||
case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded:
|
||||
cleanCommitMessageFile();
|
||||
return true; // Cancel all
|
||||
default:
|
||||
@@ -772,7 +772,7 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
|
||||
|
||||
|
||||
// Go ahead!
|
||||
VCSBase::SubmitFileModel *model = qobject_cast<VCSBase::SubmitFileModel *>(editor->fileModel());
|
||||
VcsBase::SubmitFileModel *model = qobject_cast<VcsBase::SubmitFileModel *>(editor->fileModel());
|
||||
bool closeEditor = true;
|
||||
if (model->hasCheckedFiles() || !m_commitAmendSHA1.isEmpty()) {
|
||||
// get message & commit
|
||||
@@ -794,7 +794,7 @@ void GitPlugin::fetch()
|
||||
|
||||
void GitPlugin::pull()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
|
||||
switch (m_gitClient->ensureStash(state.topLevel())) {
|
||||
@@ -809,7 +809,7 @@ void GitPlugin::pull()
|
||||
|
||||
void GitPlugin::push()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
m_gitClient->synchronousPush(state.topLevel());
|
||||
}
|
||||
@@ -829,7 +829,7 @@ static inline GitClientMemberFunc memberFunctionFromAction(const QObject *o)
|
||||
|
||||
void GitPlugin::gitClientMemberFuncRepositoryAction()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
// Retrieve member function and invoke on repository
|
||||
GitClientMemberFunc func = memberFunctionFromAction(sender());
|
||||
@@ -839,14 +839,14 @@ void GitPlugin::gitClientMemberFuncRepositoryAction()
|
||||
|
||||
void GitPlugin::cleanProject()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasProject(), return)
|
||||
cleanRepository(state.currentProjectPath());
|
||||
}
|
||||
|
||||
void GitPlugin::cleanRepository()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
cleanRepository(state.topLevel());
|
||||
}
|
||||
@@ -879,7 +879,7 @@ void GitPlugin::cleanRepository(const QString &directory)
|
||||
it->truncate(it->size() - 1);
|
||||
|
||||
// Show in dialog
|
||||
VCSBase::CleanDialog dialog(parent);
|
||||
VcsBase::CleanDialog dialog(parent);
|
||||
dialog.setFileList(directory, files);
|
||||
dialog.exec();
|
||||
}
|
||||
@@ -903,7 +903,7 @@ static bool ensureFileSaved(const QString &fileName)
|
||||
|
||||
void GitPlugin::applyCurrentFilePatch()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasPatchFile() && state.hasTopLevel(), return);
|
||||
const QString patchFile = state.currentPatchFile();
|
||||
if (!ensureFileSaved(patchFile))
|
||||
@@ -913,7 +913,7 @@ void GitPlugin::applyCurrentFilePatch()
|
||||
|
||||
void GitPlugin::promptApplyPatch()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
applyPatch(state.topLevel(), QString());
|
||||
}
|
||||
@@ -939,7 +939,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
|
||||
return;
|
||||
}
|
||||
// Run!
|
||||
VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance();
|
||||
VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance();
|
||||
QString errorMessage;
|
||||
if (m_gitClient->synchronousApplyPatch(workingDirectory, file, &errorMessage)) {
|
||||
if (errorMessage.isEmpty()) {
|
||||
@@ -955,7 +955,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
|
||||
void GitPlugin::stash()
|
||||
{
|
||||
// Simple stash without prompt, reset repo.
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
const QString id = m_gitClient->synchronousStash(state.topLevel(), QString(), 0);
|
||||
if (!id.isEmpty() && m_stashDialog)
|
||||
@@ -965,7 +965,7 @@ void GitPlugin::stash()
|
||||
void GitPlugin::stashSnapshot()
|
||||
{
|
||||
// Prompt for description, restore immediately and keep on working.
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return)
|
||||
const QString id = m_gitClient->synchronousStash(state.topLevel(), QString(), GitClient::StashImmediateRestore|GitClient::StashPromptDescription);
|
||||
if (!id.isEmpty() && m_stashDialog)
|
||||
@@ -1002,7 +1002,7 @@ void GitPlugin::stashList()
|
||||
showNonModalDialog(currentState().topLevel(), m_stashDialog);
|
||||
}
|
||||
|
||||
void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
|
||||
void GitPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
|
||||
{
|
||||
const bool repositoryEnabled = currentState().hasTopLevel();
|
||||
if (m_stashDialog)
|
||||
@@ -1036,7 +1036,7 @@ void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
|
||||
|
||||
void GitPlugin::showCommit()
|
||||
{
|
||||
const VCSBase::VCSBasePluginState state = currentState();
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
|
||||
if (!m_changeSelectionDialog)
|
||||
m_changeSelectionDialog = new ChangeSelectionDialog();
|
||||
|
||||
@@ -84,7 +84,7 @@ typedef void (GitClient::*GitClientMemberFunc)(const QString &);
|
||||
typedef QPair<QAction *, Core::Command* > ActionCommandPair;
|
||||
typedef QPair<Utils::ParameterAction *, Core::Command* > ParameterActionCommandPair;
|
||||
|
||||
class GitPlugin : public VCSBase::VCSBasePlugin
|
||||
class GitPlugin : public VcsBase::VcsBasePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -136,8 +136,8 @@ private slots:
|
||||
void push();
|
||||
|
||||
protected:
|
||||
virtual void updateActions(VCSBase::VCSBasePlugin::ActionState);
|
||||
virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor);
|
||||
virtual void updateActions(VcsBase::VcsBasePlugin::ActionState);
|
||||
virtual bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor);
|
||||
|
||||
private:
|
||||
inline ParameterActionCommandPair
|
||||
|
||||
@@ -105,7 +105,7 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
|
||||
|
||||
GitSettings &GitSettings::operator = (const GitSettings &s)
|
||||
{
|
||||
VCSBaseClientSettings::operator =(s);
|
||||
VcsBaseClientSettings::operator =(s);
|
||||
m_binaryPath.clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
// Todo: Add user name and password?
|
||||
class GitSettings : public VCSBase::VCSBaseClientSettings
|
||||
class GitSettings : public VcsBase::VcsBaseClientSettings
|
||||
{
|
||||
public:
|
||||
GitSettings();
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace Internal {
|
||||
* option for staged files. So, we sort apart the diff file lists
|
||||
* according to a type flag we add to the model. */
|
||||
|
||||
GitSubmitEditor::GitSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) :
|
||||
VCSBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)),
|
||||
GitSubmitEditor::GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent) :
|
||||
VcsBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)),
|
||||
m_model(0)
|
||||
{
|
||||
connect(this, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiffSelected(QStringList)));
|
||||
@@ -68,7 +68,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
|
||||
|
||||
m_commitEncoding = d.commitEncoding;
|
||||
|
||||
m_model = new VCSBase::SubmitFileModel(this);
|
||||
m_model = new VcsBase::SubmitFileModel(this);
|
||||
if (!d.files.isEmpty()) {
|
||||
for (QList<CommitData::StateFilePair>::const_iterator it = d.files.constBegin();
|
||||
it != d.files.constEnd(); ++it) {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
namespace VCSBase {
|
||||
namespace VcsBase {
|
||||
class SubmitFileModel;
|
||||
}
|
||||
|
||||
@@ -48,11 +48,11 @@ class GitSubmitEditorWidget;
|
||||
class CommitData;
|
||||
struct GitSubmitEditorPanelData;
|
||||
|
||||
class GitSubmitEditor : public VCSBase::VCSBaseSubmitEditor
|
||||
class GitSubmitEditor : public VcsBase::VcsBaseSubmitEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GitSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent);
|
||||
explicit GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent);
|
||||
|
||||
void setCommitData(const CommitData &);
|
||||
GitSubmitEditorPanelData panelData() const;
|
||||
@@ -69,7 +69,7 @@ private slots:
|
||||
private:
|
||||
inline GitSubmitEditorWidget *submitEditorWidget();
|
||||
|
||||
VCSBase::SubmitFileModel *m_model;
|
||||
VcsBase::SubmitFileModel *m_model;
|
||||
QString m_commitEncoding;
|
||||
};
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ QString GitVersionControl::displayName() const
|
||||
|
||||
QString GitVersionControl::id() const
|
||||
{
|
||||
return QLatin1String(VCSBase::Constants::VCS_ID_GIT);
|
||||
return QLatin1String(VcsBase::Constants::VCS_ID_GIT);
|
||||
}
|
||||
|
||||
bool GitVersionControl::isConfigured() const
|
||||
|
||||
@@ -133,7 +133,7 @@ void RemoteDialog::refresh(const QString &repository, bool force)
|
||||
} else {
|
||||
QString errorMessage;
|
||||
if (!m_remoteModel->refresh(m_repository, &errorMessage))
|
||||
VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ SettingsPage::SettingsPage() :
|
||||
|
||||
QString SettingsPage::id() const
|
||||
{
|
||||
return QLatin1String(VCSBase::Constants::VCS_ID_GIT);
|
||||
return QLatin1String(VcsBase::Constants::VCS_ID_GIT);
|
||||
}
|
||||
|
||||
QString SettingsPage::displayName() const
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
Ui::SettingsPage m_ui;
|
||||
};
|
||||
|
||||
class SettingsPage : public VCSBase::VCSBaseOptionsPage
|
||||
class SettingsPage : public VcsBase::VcsBaseOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user