summaryrefslogtreecommitdiff
path: root/src/plugins/bazaar/bazaarplugin.cpp
diff options
context:
space:
mode:
authorHugues Delorme <delorme.hugues@fougsys.fr>2013-12-06 14:56:24 +0100
committerHugues Delorme <delorme.hugues@fougsys.fr>2013-12-11 15:35:06 +0100
commite922cd234b4452906bf711938b6e6fd67d80b069 (patch)
treec5f7d64b15597a22e8748049c237addaadc9d253 /src/plugins/bazaar/bazaarplugin.cpp
parent05a26599aeee3fe17c2298bfc672d68108594418 (diff)
downloadqt-creator-e922cd234b4452906bf711938b6e6fd67d80b069.tar.gz
Bzr: add support for "uncommit" command
All "bzr uncommit" options are supported, even --dry-run (allowing user to check the green light) Change-Id: Ib97ef1333709ad18be53c658c23c97356e4e4ce0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/bazaar/bazaarplugin.cpp')
-rw-r--r--src/plugins/bazaar/bazaarplugin.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp
index 47045f8eb6..1ca6863a85 100644
--- a/src/plugins/bazaar/bazaarplugin.cpp
+++ b/src/plugins/bazaar/bazaarplugin.cpp
@@ -34,6 +34,7 @@
#include "bazaarcommitwidget.h"
#include "bazaareditor.h"
#include "pullorpushdialog.h"
+#include "uncommitdialog.h"
#include "commiteditor.h"
#include "clonewizard.h"
@@ -421,6 +422,13 @@ void BazaarPlugin::createRepositoryActions(const Core::Context &context)
m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command);
+ action = new QAction(tr("Uncommit..."), this);
+ m_repositoryActionList.append(action);
+ command = Core::ActionManager::registerAction(action, Core::Id(Constants::UNCOMMIT), context);
+ connect(action, SIGNAL(triggered()), this, SLOT(uncommit()));
+ m_bazaarContainer->addAction(command);
+ m_commandLocator->appendCommand(command);
+
QAction *createRepositoryAction = new QAction(tr("Create Repository..."), this);
command = Core::ActionManager::registerAction(createRepositoryAction, Core::Id(Constants::CREATE_REPOSITORY), context);
connect(createRepositoryAction, SIGNAL(triggered()), this, SLOT(createRepository()));
@@ -640,6 +648,16 @@ void BazaarPlugin::commitFromEditor()
Core::EditorManager::closeEditor();
}
+void BazaarPlugin::uncommit()
+{
+ const VcsBase::VcsBasePluginState state = currentState();
+ QTC_ASSERT(state.hasTopLevel(), return);
+
+ UnCommitDialog dialog;
+ if (dialog.exec() == QDialog::Accepted)
+ m_client->synchronousUncommit(state.topLevel(), dialog.revision(), dialog.extraOptions());
+}
+
bool BazaarPlugin::submitEditorAboutToClose()
{
CommitEditor *commitEditor = qobject_cast<CommitEditor *>(submitEditor());