aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-03-03 15:07:27 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-03-03 15:07:27 -0500
commitb67cc9871268bf44476e91f14eeca8d9889f5e2d (patch)
treeab7a2ee15363e3b3966a9114824407fad38cd507
parent221cc6ccd40d3e643bc65b34f2fca72ad2a69363 (diff)
parent321e4bb6da5ab1113f379daa9afba8b8773ba321 (diff)
downloadb4-b67cc9871268bf44476e91f14eeca8d9889f5e2d.tar.gz
Merge patch "ez: send: make argument to --resend optional"
Fixes to match the latest master. Link: https://msgid.link/20230217-resend-auto-version-v2-1-0830b9733993@t-8ch.de Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/command.py2
-rw-r--r--b4/ez.py12
-rw-r--r--man/b4.54
-rw-r--r--man/b4.5.rst4
4 files changed, 14 insertions, 8 deletions
diff --git a/b4/command.py b/b4/command.py
index 00d85a9..e7656a5 100644
--- a/b4/command.py
+++ b/b4/command.py
@@ -321,7 +321,7 @@ def setup_parser() -> argparse.ArgumentParser:
sp_send.add_argument('--cc', nargs='+', help='Addresses to add to the Cc: list')
sp_send.add_argument('--not-me-too', action='store_true', default=False,
help='Remove yourself from the To: or Cc: list')
- sp_send.add_argument('--resend', metavar='vN', default=None,
+ sp_send.add_argument('--resend', metavar='vN', nargs='?', const='latest',
help='Resend a previously sent version of the series')
sp_send.add_argument('--no-sign', action='store_true', default=False,
help='Do not add the cryptographic attestation signature header')
diff --git a/b4/ez.py b/b4/ez.py
index 098f231..daa1b4f 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1290,15 +1290,21 @@ def cmd_send(cmdargs: argparse.Namespace) -> None:
cl_msgid = None
cover, tracking = load_cover(strip_comments=True)
if cmdargs.resend:
+ if cmdargs.resend == 'latest':
+ revstr = tracking['series']['revision'] - 1
+ else:
+ revstr = cmdargs.resend
+
# Start with full change-id based tag name
- tagname, revision = get_sent_tagname(tracking['series']['change-id'], SENT_TAG_PREFIX, cmdargs.resend)
+ tagname, revision = get_sent_tagname(tracking['series']['change-id'], SENT_TAG_PREFIX, revstr)
+
if revision is None:
- logger.critical('Could not figure out revision from %s', cmdargs.resend)
+ logger.critical('Could not figure out revision from %s', revstr)
sys.exit(1)
if not b4.git_revparse_tag(None, tagname):
# Try initial branch-name only based version
- tagname, revision = get_sent_tagname(mybranch, SENT_TAG_PREFIX, cmdargs.resend)
+ tagname, revision = get_sent_tagname(mybranch, SENT_TAG_PREFIX, revstr)
try:
todests, ccdests, patches = get_sent_tag_as_patches(tagname, revision=revision)
diff --git a/man/b4.5 b/man/b4.5
index deea551..4295834 100644
--- a/man/b4.5
+++ b/man/b4.5
@@ -608,7 +608,7 @@ Enroll current branch, using the passed tag, branch, or commit as fork base
.INDENT 0.0
.TP
.B usage:
-b4 send [\-h] [\-d] [\-o OUTPUT_DIR] [\-\-reflect] [\-\-no\-trailer\-to\-cc] [\-\-to TO [TO ...]] [\-\-cc CC [CC ...]] [\-\-not\-me\-too] [\-\-resend RESEND] [\-\-no\-sign] [\-\-web\-auth\-new] [\-\-web\-auth\-verify VERIFY_TOKEN]
+b4 send [\-h] [\-d] [\-o OUTPUT_DIR] [\-\-reflect] [\-\-no\-trailer\-to\-cc] [\-\-to TO [TO ...]] [\-\-cc CC [CC ...]] [\-\-not\-me\-too] [\-\-resend [RESEND]] [\-\-no\-sign] [\-\-web\-auth\-new] [\-\-web\-auth\-verify VERIFY_TOKEN]
.TP
.B options:
.INDENT 7.0
@@ -641,7 +641,7 @@ Addresses to add to the Cc: list
.B \-\-not\-me\-too
Remove yourself from the To: or Cc: list
.TP
-.BI \-\-resend \ RESEND
+.BI \-\-resend \ [RESEND]
Resend a previously sent version of the series
.TP
.B \-\-no\-sign
diff --git a/man/b4.5.rst b/man/b4.5.rst
index 7419aec..a21dd4c 100644
--- a/man/b4.5.rst
+++ b/man/b4.5.rst
@@ -393,7 +393,7 @@ Enroll existing branch:
b4 send
~~~~~~~
usage:
- b4 send [-h] [-d] [-o OUTPUT_DIR] [--reflect] [--no-trailer-to-cc] [--to TO [TO ...]] [--cc CC [CC ...]] [--not-me-too] [--resend RESEND] [--no-sign] [--web-auth-new] [--web-auth-verify VERIFY_TOKEN]
+ b4 send [-h] [-d] [-o OUTPUT_DIR] [--reflect] [--no-trailer-to-cc] [--to TO [TO ...]] [--cc CC [CC ...]] [--not-me-too] [--resend [RESEND]] [--no-sign] [--web-auth-new] [--web-auth-verify VERIFY_TOKEN]
options:
-h, --help show this help message and exit
@@ -414,7 +414,7 @@ options:
--not-me-too
Remove yourself from the To: or Cc: list
- --resend RESEND
+ --resend [RESEND]
Resend a previously sent version of the series
--no-sign
Do not add the cryptographic attestation signature header