forked from qt-creator/qt-creator
Gerrit - use new diff editor for diff
Change-Id: I7ba84491a5f6796ff446c2e21487ed4c04441b82 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -202,11 +202,11 @@ void GerritDialog::displayRepositoryPath()
|
||||
if (m_repositoryChooser->path().isEmpty())
|
||||
m_repositoryChooser->setPath(m_parameters->repositoryPath);
|
||||
if (m_parameters->promptPath) {
|
||||
m_displayButton->setText(tr("&Diff..."));
|
||||
m_displayButton->setText(tr("&Show..."));
|
||||
m_cherryPickButton->setText(tr("Cherry &Pick..."));
|
||||
m_checkoutButton->setText(tr("&Checkout..."));
|
||||
} else {
|
||||
m_displayButton->setText(tr("&Diff"));
|
||||
m_displayButton->setText(tr("&Show"));
|
||||
m_cherryPickButton->setText(tr("Cherry &Pick"));
|
||||
m_checkoutButton->setText(tr("&Checkout"));
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@ void FetchContext::start()
|
||||
|
||||
void FetchContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||
{
|
||||
Git::Internal::GitClient *client = Git::Internal::GitPlugin::instance()->gitClient();
|
||||
if (es != QProcess::NormalExit) {
|
||||
handleError(tr("%1 crashed.").arg(m_git));
|
||||
return;
|
||||
@@ -199,16 +200,22 @@ void FetchContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||
m_progress.setProgressValue(m_progress.progressValue() + 1);
|
||||
switch (m_fetchMode) {
|
||||
case FetchDisplay:
|
||||
m_state = WritePatchFileState;
|
||||
startWritePatchFile();
|
||||
if (client->settings()->boolValue(Git::Internal::GitSettings::useDiffEditorKey)) {
|
||||
client->show(m_repository, QLatin1String("FETCH_HEAD"));
|
||||
m_progress.reportFinished();
|
||||
m_state = DoneState;
|
||||
deleteLater();
|
||||
} else {
|
||||
m_state = WritePatchFileState;
|
||||
startWritePatchFile();
|
||||
}
|
||||
break;
|
||||
case FetchCherryPick:
|
||||
case FetchCheckout:
|
||||
if (m_fetchMode == FetchCherryPick) {
|
||||
cherryPick();
|
||||
} else {
|
||||
Git::Internal::GitPlugin::instance()->gitClient()->synchronousCheckout(
|
||||
m_repository, QLatin1String("FETCH_HEAD"));
|
||||
client->synchronousCheckout(m_repository, QLatin1String("FETCH_HEAD"));
|
||||
}
|
||||
m_progress.reportFinished();
|
||||
m_state = DoneState;
|
||||
|
||||
Reference in New Issue
Block a user