diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-05-12 21:25:31 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2013-05-27 10:43:44 +0200 |
commit | b75cf9686857da1166ce1b71cfb21da53e1c712e (patch) | |
tree | fa56447460849cf21530b58ee1c359f989795579 /src/plugins/git/branchdialog.cpp | |
parent | 829357b39739f31ff68bf2e066e594c75f352243 (diff) | |
download | qt-creator-b75cf9686857da1166ce1b71cfb21da53e1c712e.tar.gz |
Git: Refactor stash handling
* Replace RebaseManager with ConflictHandler
* Store StashGuard in GitClient, allow popping after
a whole process is done (e.g. pull with resolved conflicts)
Change-Id: I85784f32f515ff896c73f35303c7de26f8006f59
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/branchdialog.cpp')
-rw-r--r-- | src/plugins/git/branchdialog.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 2c7dca4b28..e57ff1bd0f 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -189,14 +189,9 @@ void BranchDialog::checkout() if (branchCheckoutDialog.makeStashOfCurrentBranch() || branchCheckoutDialog.moveLocalChangesToNextBranch()) { - GitClient::StashGuard stashGuard(m_repository, - currentBranch + QLatin1String("-AutoStash"), - NoPrompt); - if (stashGuard.stashingFailed()) + if (!gitClient->beginStashScope(m_repository, currentBranch + QLatin1String("-AutoStash"), NoPrompt)) return; - stashGuard.preventPop(); - stashMessage = stashGuard.stashMessage(); - + stashMessage = gitClient->stashInfo(m_repository).stashMessage(); } else if (branchCheckoutDialog.discardLocalChanges()) { gitClient->synchronousReset(m_repository); } @@ -295,9 +290,9 @@ void BranchDialog::merge() QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled! const QString branch = m_model->branchName(idx); - GitClient::StashGuard stashGuard(m_repository, QLatin1String("merge"), AllowUnstashed); - if (!GitPlugin::instance()->gitClient()->synchronousMerge(m_repository, branch)) - stashGuard.preventPop(); + GitClient *client = GitPlugin::instance()->gitClient(); + if (client->beginStashScope(m_repository, QLatin1String("merge"), AllowUnstashed)) + client->synchronousMerge(m_repository, branch); } void BranchDialog::rebase() @@ -307,9 +302,9 @@ void BranchDialog::rebase() QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled! const QString baseBranch = m_model->branchName(idx); - GitClient::StashGuard stashGuard(m_repository, QLatin1String("rebase")); - if (!GitPlugin::instance()->gitClient()->synchronousRebase(m_repository, baseBranch)) - stashGuard.preventPop(); + GitClient *client = GitPlugin::instance()->gitClient(); + if (client->beginStashScope(m_repository, QLatin1String("rebase"))) + client->synchronousRebase(m_repository, baseBranch); } QModelIndex BranchDialog::selectedIndex() |