Git: Allow direct push after commit

Git commit dialog: Added a drop-down menu to the commit button to
execute "git push" or open the "Push to Gerrit" dialog directly after
a commit or amend.

Task-number: QTCREATORBUG-8854
Change-Id: I00ff8f816d1768e0cdaf6929126b55826788e578
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2013-04-25 13:04:45 +02:00
committed by André Hartmann
parent 02825b5894
commit 9654df9f1f
11 changed files with 97 additions and 9 deletions

View File

@@ -1121,6 +1121,14 @@ bool GitPlugin::submitEditorAboutToClose()
m_gitClient->continueCommandIfNeeded(m_submitRepository);
}
}
if (m_gitClient->checkCommandInProgress(m_submitRepository) == GitClient::NoCommand) {
if (editor->panelData().pushAction == CommitAndPush)
m_gitClient->push(m_submitRepository);
else if (editor->panelData().pushAction == CommitAndPushToGerrit)
connect(editor, SIGNAL(destroyed()), this, SLOT(delayedPushToGerrit()));
}
return closeEditor;
}
@@ -1445,6 +1453,11 @@ void GitPlugin::updateContinueAndAbortCommands()
}
}
void GitPlugin::delayedPushToGerrit()
{
m_gerritPlugin->push(m_submitRepository);
}
void GitPlugin::updateBranches(const QString &repository)
{
if (m_branchDialog && m_branchDialog->isVisible())