summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2022-02-17 15:48:56 +0100
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2022-03-01 11:32:58 +0000
commit08ca9944715735726d36f7d82123dc299f73335d (patch)
tree1fc40d04d34a9e900bc8267037c8da3dc38d210b
parentc4d197e48965c03348891ee1af415222641482af (diff)
downloadqtrepotools-08ca9944715735726d36f7d82123dc299f73335d.tar.gz
gpush: change how unspecified reviewer type is represented
in preparation of supporting both specified (via REST) and unspecified (via SSH) reviewer types. Change-Id: I79cf8200d9d9a717e6b65ecd17ead88c39879cec Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rwxr-xr-xbin/git-gpush6
-rw-r--r--bin/git_gpush.pm5
2 files changed, 7 insertions, 4 deletions
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;