forked from qt-creator/qt-creator
Gerrit: Use magic branch options to specify reviewers
Enables specifying reviewers over http[s]. Supported since gerrit 2.6 (specifying reviewers will be broken for earlier versions). Prepare for supporting other options (draft, publish, topic...) Change-Id: Id0b6508409123cddb9dec5ea9e78d7a6a1423057 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
caef827cd7
commit
49b0b5d3eb
@@ -326,16 +326,6 @@ void GerritPlugin::push(const QString &topLevel)
|
|||||||
QStringList args;
|
QStringList args;
|
||||||
|
|
||||||
m_reviewers = dialog.reviewers();
|
m_reviewers = dialog.reviewers();
|
||||||
const QStringList reviewers = m_reviewers.split(QLatin1Char(','), QString::SkipEmptyParts);
|
|
||||||
if (!reviewers.isEmpty()) {
|
|
||||||
QString reviewersFlag(QLatin1String("--receive-pack=git receive-pack"));
|
|
||||||
foreach (const QString &reviewer, reviewers) {
|
|
||||||
const QString name = reviewer.trimmed();
|
|
||||||
if (!name.isEmpty())
|
|
||||||
reviewersFlag += QString::fromLatin1(" --reviewer=") + name;
|
|
||||||
}
|
|
||||||
args << reviewersFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
args << dialog.selectedRemoteName();
|
args << dialog.selectedRemoteName();
|
||||||
QString target = dialog.selectedCommit();
|
QString target = dialog.selectedCommit();
|
||||||
@@ -346,6 +336,15 @@ void GerritPlugin::push(const QString &topLevel)
|
|||||||
const QString topic = dialog.selectedTopic();
|
const QString topic = dialog.selectedTopic();
|
||||||
if (!topic.isEmpty())
|
if (!topic.isEmpty())
|
||||||
target += QLatin1Char('/') + topic;
|
target += QLatin1Char('/') + topic;
|
||||||
|
|
||||||
|
QStringList options;
|
||||||
|
const QStringList reviewers = m_reviewers.split(QLatin1Char(','), QString::SkipEmptyParts);
|
||||||
|
foreach (const QString &reviewer, reviewers)
|
||||||
|
options << QLatin1String("r=") + reviewer;
|
||||||
|
|
||||||
|
if (!options.isEmpty())
|
||||||
|
target += QLatin1Char('%') + options.join(QLatin1String(","));
|
||||||
|
|
||||||
args << target;
|
args << target;
|
||||||
|
|
||||||
gitClient()->push(topLevel, args);
|
gitClient()->push(topLevel, args);
|
||||||
|
|||||||
Reference in New Issue
Block a user