forked from qt-creator/qt-creator
Git: Save all documents before stash pop
... and refresh the stash dialog Change-Id: Iba16efc4f612cd1997493206704100ec57493932 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
15e7446fda
commit
2a677ce8b3
@@ -3273,11 +3273,6 @@ void GitClient::stashPop(const QString &workingDirectory, const QString &stash)
|
||||
new ConflictHandler(cmd, workingDirectory);
|
||||
}
|
||||
|
||||
void GitClient::stashPop(const QString &workingDirectory)
|
||||
{
|
||||
stashPop(workingDirectory, QString());
|
||||
}
|
||||
|
||||
bool GitClient::synchronousStashRestore(const QString &workingDirectory,
|
||||
const QString &stash,
|
||||
bool pop,
|
||||
|
||||
@@ -278,8 +278,7 @@ public:
|
||||
void synchronousSubversionFetch(const QString &workingDirectory);
|
||||
void subversionLog(const QString &workingDirectory);
|
||||
|
||||
void stashPop(const QString &workingDirectory, const QString &stash);
|
||||
void stashPop(const QString &workingDirectory);
|
||||
void stashPop(const QString &workingDirectory, const QString &stash = QString());
|
||||
void revert(const QStringList &files, bool revertStaging);
|
||||
bool synchronousStashList(const QString &workingDirectory,
|
||||
QList<Stash> *stashes,
|
||||
|
||||
@@ -509,7 +509,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
stashMenu->addSeparator(context);
|
||||
|
||||
action = createRepositoryAction(stashMenu, tr("Stash Pop"), "Git.StashPop",
|
||||
context, true, &GitClient::stashPop);
|
||||
context, true, SLOT(stashPop()));
|
||||
action->setToolTip(tr("Restores changes saved to the stash list using \"Stash\"."));
|
||||
|
||||
|
||||
@@ -1284,6 +1284,16 @@ void GitPlugin::stashSnapshot()
|
||||
m_stashDialog->refresh(state.topLevel(), true);
|
||||
}
|
||||
|
||||
void GitPlugin::stashPop()
|
||||
{
|
||||
if (!DocumentManager::saveAllModifiedDocuments())
|
||||
return;
|
||||
const QString repository = currentState().topLevel();
|
||||
m_gitClient->stashPop(repository);
|
||||
if (m_stashDialog)
|
||||
m_stashDialog->refresh(repository, true);
|
||||
}
|
||||
|
||||
// Create a non-modal dialog with refresh function or raise if it exists
|
||||
template <class NonModalDialog>
|
||||
inline void showNonModalDialog(const QString &topLevel,
|
||||
|
||||
@@ -127,6 +127,7 @@ private slots:
|
||||
void startFixupCommit();
|
||||
void stash();
|
||||
void stashSnapshot();
|
||||
void stashPop();
|
||||
void branchList();
|
||||
void remoteList();
|
||||
void stashList();
|
||||
|
||||
Reference in New Issue
Block a user