summaryrefslogtreecommitdiff
path: root/tools/dist/backport.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dist/backport.pl')
-rwxr-xr-xtools/dist/backport.pl25
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/dist/backport.pl b/tools/dist/backport.pl
index df3da22..32c62e5 100755
--- a/tools/dist/backport.pl
+++ b/tools/dist/backport.pl
@@ -9,11 +9,11 @@ use v5.10.0; # needed for $^V
# experimental and "subject to change" in v5.18 (see perl5180delta). Every
# use of it now triggers a warning.
#
-# As of Perl v5.26.1, the semantics of given/when provided by Perl are
+# As of Perl v5.30.0, the semantics of given/when provided by Perl are
# compatible with those expected by the script, so disable the warning for
# those Perls. But don't try to disable the the warning category on Perls
# that don't know that category, since that breaks compilation.
-no if (v5.17.0 le $^V and $^V le v5.26.1),
+no if (v5.17.0 le $^V and $^V le v5.30.0),
warnings => 'experimental::smartmatch';
# Licensed to the Apache Software Foundation (ASF) under one
@@ -157,7 +157,7 @@ N: Move to the next entry. Do not prompt for the current entry again, even
revisions added, justification changed) in the repository.
(This is a local action that will not affect other people or bots.)
: Move to the next entry. Prompt for the current entry again in the next
- run of backport.pl.
+ run of backport.pl.
(That's a space character, ASCII 0x20.)
?: Display this list.
EOF
@@ -231,7 +231,7 @@ Both batch modes also perform a basic sanity-check on entries that declare
backport branches (via the "Branch:" header): if a backport branch is used, but
at least one of the revisions enumerated in the entry title had neither been
merged from $TRUNK to the branch root, nor been committed
-directly to the backport branch, the hourly bot will turn red and
+directly to the backport branch, the hourly bot will turn red and
nightly bot will skip the entry and email its admins. (The nightly bot does
not email the list on failure, since it doesn't use buildbot.)
@@ -262,6 +262,9 @@ numbers); it will be ignored. For example,
$0 "Committed revision 42." "\$Some_justification"
will nominate r42.
+Revision numbers within the last thousand revisions may be specified using
+the last three digits only.
+
The justification can be an arbitrarily-long string; if it is wider than the
available width, this script will wrap it for you (and allow you to review
the result before committing).
@@ -1238,6 +1241,20 @@ sub nominate_main {
die "Unable to proceed." if warned_cannot_commit "Nominating failed";
+ # To save typing, require just the last three digits if they're unambiguous.
+ my $BASE_revision = `$SVN info --show-item=revision` + 0;
+ if ($BASE_revision > 1000) {
+ my $residue = $BASE_revision % 1000;
+ my $thousands = $BASE_revision - $residue;
+ @revnums = map {
+ $_ >= 1000
+ ? $_
+ : $thousands + $_ - 1000 * ($_ > $residue)
+ }
+ @revnums;
+ }
+
+ # Deduplicate and sort
@revnums = sort { $a <=> $b } keys %{{ map { $_ => 1 } @revnums }};
die "No revision numbers specified" unless @revnums;