forked from qt-creator/qt-creator
Git: Introduce MergeTool support
Change-Id: I906c3c692d9f4819bdf2a1489c42ae04f292894d Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
438e4af735
commit
cf6298ff32
@@ -43,6 +43,7 @@
|
||||
#include "stashdialog.h"
|
||||
#include "settingspage.h"
|
||||
#include "resetdialog.h"
|
||||
#include "mergetool.h"
|
||||
|
||||
#include "gerrit/gerritplugin.h"
|
||||
|
||||
@@ -519,6 +520,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
tr("Amend Last Commit..."), Core::Id("Git.AmendCommit"),
|
||||
globalcontext, true, SLOT(startAmendCommit()));
|
||||
|
||||
createRepositoryAction(gitContainer,
|
||||
tr("Merge Tool"), Core::Id("Git.MergeTool"),
|
||||
globalcontext, true, SLOT(startMergeTool()));
|
||||
|
||||
// Subversion in a submenu.
|
||||
gitContainer->addSeparator(globalcontext);
|
||||
|
||||
@@ -565,6 +570,11 @@ void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList
|
||||
m_gitClient->diff(m_submitRepository, QStringList(), unstaged, staged);
|
||||
}
|
||||
|
||||
void GitPlugin::submitEditorMerge(const QStringList &unmerged)
|
||||
{
|
||||
m_gitClient->merge(m_submitRepository, unmerged);
|
||||
}
|
||||
|
||||
void GitPlugin::diffCurrentFile()
|
||||
{
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
@@ -708,6 +718,7 @@ Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const Commit
|
||||
if (amend) // Allow for just correcting the message
|
||||
submitEditor->setEmptyFileListEnabled(true);
|
||||
connect(submitEditor, SIGNAL(diff(QStringList,QStringList)), this, SLOT(submitEditorDiff(QStringList,QStringList)));
|
||||
connect(submitEditor, SIGNAL(merge(QStringList)), this, SLOT(submitEditorMerge(QStringList)));
|
||||
return editor;
|
||||
}
|
||||
|
||||
@@ -804,6 +815,13 @@ void GitPlugin::push()
|
||||
m_gitClient->synchronousPush(state.topLevel());
|
||||
}
|
||||
|
||||
void GitPlugin::startMergeTool()
|
||||
{
|
||||
const VcsBase::VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasTopLevel(), return);
|
||||
m_gitClient->merge(state.topLevel());
|
||||
}
|
||||
|
||||
// Retrieve member function of git client stored as user data of action
|
||||
static inline GitClientMemberFunc memberFunctionFromAction(const QObject *o)
|
||||
{
|
||||
|
Reference in New Issue
Block a user