diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index a8377144ecd..249c1e39d60 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -379,6 +379,18 @@ void GerritPlugin::push() QStringList args; + const QStringList reviewers = dialog->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(); QString target = QLatin1String("HEAD:refs/") + dialog->selectedPushType() + QLatin1Char('/') + dialog->selectedRemoteBranchName(); diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index 1e45a5e5fdb..bd1025e538e 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -202,5 +202,10 @@ QString GerritPushDialog::selectedTopic() const return m_ui->topicLineEdit->text().trimmed(); } +QString GerritPushDialog::reviewers() const +{ + return m_ui->reviewersLineEdit->text(); +} + } // namespace Internal } // namespace Gerrit diff --git a/src/plugins/git/gerrit/gerritpushdialog.h b/src/plugins/git/gerrit/gerritpushdialog.h index 3b27d2954b5..c976dbb1eb2 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.h +++ b/src/plugins/git/gerrit/gerritpushdialog.h @@ -51,6 +51,7 @@ public: QString selectedRemoteBranchName() const; QString selectedPushType() const; QString selectedTopic() const; + QString reviewers() const; bool localChangesFound() const; private slots: diff --git a/src/plugins/git/gerrit/gerritpushdialog.ui b/src/plugins/git/gerrit/gerritpushdialog.ui index f0e9e5c84b6..e6969827b30 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.ui +++ b/src/plugins/git/gerrit/gerritpushdialog.ui @@ -7,7 +7,7 @@ 0 0 306 - 331 + 407 @@ -69,9 +69,9 @@ Remote Branch: - - - + + QFormLayout::AllNonFixedFieldsGrow + @@ -82,6 +82,9 @@ + + + @@ -98,7 +101,7 @@ - &Topic + &Topic: topicLineEdit @@ -111,6 +114,29 @@ + + + + + + R&eviewers: + + + reviewersLineEdit + + + + + + + Comma-separated list of reviewers. + +Partial names can be used if they are unambiguous. + + + + +