Commit bd5afaf4 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Gerrit: Gracefully handle error retrieving branch distance



Change-Id: If4f6babe654a6f667c36ac3afb851b078439d3b6
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 143e23f4
......@@ -184,9 +184,9 @@ QString GerritPushDialog::calculateChangeRange(const QString &branch)
args << QLatin1String("--count");
QString number;
QString error;
if (!m_client->synchronousRevListCmd(m_workingDir, args, &number))
reject();
m_client->synchronousRevListCmd(m_workingDir, args, &number, &error);
number.chop(1);
return number;
......@@ -201,14 +201,16 @@ void GerritPushDialog::setChangeRange()
const QString remoteBranchName = selectedRemoteBranchName();
if (remoteBranchName.isEmpty())
return;
QString remote = selectedRemoteName();
remote += QLatin1Char('/');
remote += remoteBranchName;
const QString branch = m_ui->localBranchComboBox->currentText();
m_ui->infoLabel->setText(tr("Number of commits between %1 and %2: %3")
.arg(branch)
.arg(remote)
.arg(calculateChangeRange(branch)));
const QString range = calculateChangeRange(branch);
if (range.isEmpty()) {
m_ui->infoLabel->hide();
return;
}
m_ui->infoLabel->show();
const QString remote = selectedRemoteName() + QLatin1Char('/') + remoteBranchName;
m_ui->infoLabel->setText(
tr("Number of commits between %1 and %2: %3").arg(branch, remote, range));
}
bool GerritPushDialog::isValid() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment