Git: Offer recent list of changes for reset --hard.

This makes it easier to remove changed applied for review
by Gerrit.

Change-Id: I2e3407ae4e74b650d08d53fed37e9aeb11071a4e
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Friedemann Kleint
2012-04-30 17:26:07 +02:00
parent aefb7d061c
commit 9a5fa0dd48
6 changed files with 254 additions and 11 deletions

View File

@@ -45,6 +45,7 @@
#include "gitoriousclonewizard.h"
#include "stashdialog.h"
#include "settingspage.h"
#include "resetdialog.h"
#include <gerritplugin.h>
@@ -643,15 +644,10 @@ void GitPlugin::undoRepositoryChanges()
{
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
= QMessageBox::question(Core::ICore::mainWindow(),
tr("Undo Changes"), msg,
QMessageBox::Yes|QMessageBox::No,
QMessageBox::No);
if (answer == QMessageBox::No)
return;
m_gitClient->hardReset(state.topLevel(), QString());
ResetDialog dialog;
if (dialog.runDialog(state.topLevel()))
m_gitClient->hardReset(state.topLevel(), dialog.commit());
}
void GitPlugin::stageFile()