From 87f52f308c48c11a99cefcc308a0994abeb2a7ff Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 30 Jun 2024 20:12:07 -0400 Subject: upload: add a --topic option for setting topic explicitly Let people specify the exact topic when uploading CLs. The existing -t option only supports setting the topic to the current local branch. Add a --topic-branch long option to the existing -t to align it a bit better with --hashtag & --hashtag-branch. Change-Id: I010abc4a7f3c685021cae776dd1e597c22b79135 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/431997 Tested-by: Mike Frysinger Reviewed-by: Gavin Mak Commit-Queue: Mike Frysinger --- project.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index 80a6c395..edf0723b 100644 --- a/project.py +++ b/project.py @@ -257,7 +257,7 @@ class ReviewableBranch: self, people, dryrun=False, - auto_topic=False, + topic=None, hashtags=(), labels=(), private=False, @@ -273,7 +273,7 @@ class ReviewableBranch: branch=self.name, people=people, dryrun=dryrun, - auto_topic=auto_topic, + topic=topic, hashtags=hashtags, labels=labels, private=private, @@ -1104,7 +1104,7 @@ class Project: branch=None, people=([], []), dryrun=False, - auto_topic=False, + topic=None, hashtags=(), labels=(), private=False, @@ -1180,8 +1180,8 @@ class Project: ref_spec = f"{R_HEADS + branch.name}:refs/for/{dest_branch}" opts = [] - if auto_topic: - opts += ["topic=" + branch.name] + if topic is not None: + opts += [f"topic={topic}"] opts += ["t=%s" % p for p in hashtags] # NB: No need to encode labels as they've been validated above. opts += ["l=%s" % p for p in labels] -- cgit v1.2.3-54-g00ecf