forked from qt-creator/qt-creator
Git: Disable rebase and fixup when there's a command in progress
Change-Id: Ifa2f781cb1f31afaf7b0af4e4a0dd08fb58296d3 Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
1686e314bd
commit
3591c1df57
@@ -59,6 +59,7 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/parameteraction.h>
|
||||
@@ -427,9 +428,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
tr("Amend Last Commit..."), Core::Id("Git.AmendCommit"),
|
||||
globalcontext, true, SLOT(startAmendCommit()));
|
||||
|
||||
createRepositoryAction(localRepositoryMenu,
|
||||
tr("Fixup Previous Commit..."), Core::Id("Git.FixupCommit"),
|
||||
globalcontext, true, SLOT(startFixupCommit()));
|
||||
m_fixupCommitAction =
|
||||
createRepositoryAction(localRepositoryMenu,
|
||||
tr("Fixup Previous Commit..."), Core::Id("Git.FixupCommit"),
|
||||
globalcontext, true, SLOT(startFixupCommit())).first;
|
||||
// --------------
|
||||
localRepositoryMenu->addSeparator(globalcontext);
|
||||
|
||||
@@ -437,9 +439,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
tr("Reset..."), Core::Id("Git.Reset"),
|
||||
globalcontext, true, SLOT(resetRepository()));
|
||||
|
||||
createRepositoryAction(localRepositoryMenu,
|
||||
tr("Interactive Rebase..."), Core::Id("Git.InteractiveRebase"),
|
||||
globalcontext, true, SLOT(startRebase()));
|
||||
m_interactiveRebaseAction =
|
||||
createRepositoryAction(localRepositoryMenu,
|
||||
tr("Interactive Rebase..."), Core::Id("Git.InteractiveRebase"),
|
||||
globalcontext, true, SLOT(startRebase())).first;
|
||||
|
||||
m_submoduleUpdateAction =
|
||||
createRepositoryAction(localRepositoryMenu,
|
||||
@@ -684,6 +687,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
m_redoAction = new QAction(tr("&Redo"), this);
|
||||
command = Core::ActionManager::registerAction(m_redoAction, Core::Constants::REDO, submitContext);
|
||||
|
||||
connect(Core::ICore::vcsManager(), SIGNAL(repositoryChanged(QString)),
|
||||
this, SLOT(updateContinueAndAbortCommands()));
|
||||
|
||||
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(RC_GIT_MIME_XML), errorMessage))
|
||||
return false;
|
||||
@@ -1408,6 +1413,8 @@ void GitPlugin::updateContinueAndAbortCommands()
|
||||
m_continueRevertAction->setVisible(gitCommandInProgress == GitClient::Revert);
|
||||
m_continueRebaseAction->setVisible(gitCommandInProgress == GitClient::Rebase
|
||||
|| gitCommandInProgress == GitClient::RebaseMerge);
|
||||
m_fixupCommitAction->setEnabled(gitCommandInProgress == GitClient::NoCommand);
|
||||
m_interactiveRebaseAction->setEnabled(gitCommandInProgress == GitClient::NoCommand);
|
||||
} else {
|
||||
m_mergeToolAction->setVisible(false);
|
||||
m_abortMergeAction->setVisible(false);
|
||||
|
Reference in New Issue
Block a user