From 08ca9944715735726d36f7d82123dc299f73335d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 17 Feb 2022 15:48:56 +0100 Subject: gpush: change how unspecified reviewer type is represented MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in preparation of supporting both specified (via REST) and unspecified (via SSH) reviewer types. Change-Id: I79cf8200d9d9a717e6b65ecd17ead88c39879cec Reviewed-by: Tor Arne Vestbø --- bin/git-gpush | 6 ++++-- bin/git_gpush.pm | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/git-gpush b/bin/git-gpush index fcc46aa..77dc221 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -1742,13 +1742,15 @@ sub prepare_meta($) my $rvrs = $ginfo ? $$ginfo{reviewers} : {}; my $any; foreach my $rvr (@reviewers) { - if (($$rvrs{$rvr} // RVRTYPE_NONE) != RVRTYPE_REV) { + my $type = $$rvrs{$rvr} // RVRTYPE_NONE; + if ($type != RVRTYPE_REV && $type != RVRTYPE_ANY) { $invite_rvrs{$rvr} = 1; $any = 1; } } foreach my $cc (@CCs) { - if (($$rvrs{$cc} // RVRTYPE_NONE) != RVRTYPE_CC) { + my $type = $$rvrs{$cc} // RVRTYPE_NONE; + if ($type != RVRTYPE_CC && $type != RVRTYPE_ANY) { $invite_ccs{$cc} = 1; $any = 1; } diff --git a/bin/git_gpush.pm b/bin/git_gpush.pm index bc0d708..455ebf0 100644 --- a/bin/git_gpush.pm +++ b/bin/git_gpush.pm @@ -684,7 +684,8 @@ sub get_commits_base($$$$) use constant { RVRTYPE_NONE => 0, RVRTYPE_REV => 1, - RVRTYPE_CC => 1 # Because Gerrit won't tell. + RVRTYPE_CC => 2, + RVRTYPE_ANY => 3 # Because Gerrit won't tell via SSH. }; our %gerrit_info_by_key; @@ -2251,7 +2252,7 @@ sub query_gerrit_only($;$) foreach my $rvr (@$rvrs) { foreach my $ky ('name', 'email', 'username') { my $val = $$rvr{$ky}; - $reviewers{$val} = RVRTYPE_REV if (defined($val)); + $reviewers{$val} = RVRTYPE_ANY if (defined($val)); } } $$ginfo{reviewers} = \%reviewers; -- cgit v1.2.1