diff options
author | Mike Frysinger <vapier@google.com> | 2024-06-30 20:12:07 -0400 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-07-01 17:54:19 +0000 |
commit | 87f52f308c48c11a99cefcc308a0994abeb2a7ff (patch) | |
tree | 00f47a3ee2fa49753e562622c7f655788ad73bdd /project.py | |
parent | 562cea77580d5f217be73f21757c7d5b32d2d11f (diff) | |
download | git-repo-87f52f308c48c11a99cefcc308a0994abeb2a7ff.tar.gz |
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 <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -257,7 +257,7 @@ class ReviewableBranch: | |||
257 | self, | 257 | self, |
258 | people, | 258 | people, |
259 | dryrun=False, | 259 | dryrun=False, |
260 | auto_topic=False, | 260 | topic=None, |
261 | hashtags=(), | 261 | hashtags=(), |
262 | labels=(), | 262 | labels=(), |
263 | private=False, | 263 | private=False, |
@@ -273,7 +273,7 @@ class ReviewableBranch: | |||
273 | branch=self.name, | 273 | branch=self.name, |
274 | people=people, | 274 | people=people, |
275 | dryrun=dryrun, | 275 | dryrun=dryrun, |
276 | auto_topic=auto_topic, | 276 | topic=topic, |
277 | hashtags=hashtags, | 277 | hashtags=hashtags, |
278 | labels=labels, | 278 | labels=labels, |
279 | private=private, | 279 | private=private, |
@@ -1104,7 +1104,7 @@ class Project: | |||
1104 | branch=None, | 1104 | branch=None, |
1105 | people=([], []), | 1105 | people=([], []), |
1106 | dryrun=False, | 1106 | dryrun=False, |
1107 | auto_topic=False, | 1107 | topic=None, |
1108 | hashtags=(), | 1108 | hashtags=(), |
1109 | labels=(), | 1109 | labels=(), |
1110 | private=False, | 1110 | private=False, |
@@ -1180,8 +1180,8 @@ class Project: | |||
1180 | 1180 | ||
1181 | ref_spec = f"{R_HEADS + branch.name}:refs/for/{dest_branch}" | 1181 | ref_spec = f"{R_HEADS + branch.name}:refs/for/{dest_branch}" |
1182 | opts = [] | 1182 | opts = [] |
1183 | if auto_topic: | 1183 | if topic is not None: |
1184 | opts += ["topic=" + branch.name] | 1184 | opts += [f"topic={topic}"] |
1185 | opts += ["t=%s" % p for p in hashtags] | 1185 | opts += ["t=%s" % p for p in hashtags] |
1186 | # NB: No need to encode labels as they've been validated above. | 1186 | # NB: No need to encode labels as they've been validated above. |
1187 | opts += ["l=%s" % p for p in labels] | 1187 | opts += ["l=%s" % p for p in labels] |