diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-19 03:00:26 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2020-02-19 18:12:28 +0000 |
commit | 7ff80afdf66e8a00745300c0375d98f2ba8887b5 (patch) | |
tree | 5068e7e9cf5c3e9176f29a524d01689522168aa0 | |
parent | 19ec797f8173cdd7a95d91306c5a8c96832e16e0 (diff) | |
download | git-repo-7ff80afdf66e8a00745300c0375d98f2ba8887b5.tar.gz |
upload: add a --hashtag-branch option akin to -t
This will automatically add the current local branch name as a hashtag.
Bug: https://crbug.com/gerrit/10477
Change-Id: I888f8be8419c801f2d98b7a2ad2486799e94f32c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255893
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
-rw-r--r-- | subcmds/upload.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 856c7fb9..ef6d0242 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -149,6 +149,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
149 | p.add_option('--hashtag', '--ht', | 149 | p.add_option('--hashtag', '--ht', |
150 | dest='hashtags', action='append', default=[], | 150 | dest='hashtags', action='append', default=[], |
151 | help='Add hashtags (comma delimited) to the review.') | 151 | help='Add hashtags (comma delimited) to the review.') |
152 | p.add_option('--hashtag-branch', '--htb', | ||
153 | action='store_true', | ||
154 | help='Add local branch name as a hashtag.') | ||
152 | p.add_option('--re', '--reviewers', | 155 | p.add_option('--re', '--reviewers', |
153 | type='string', action='append', dest='reviewers', | 156 | type='string', action='append', dest='reviewers', |
154 | help='Request reviews from these people.') | 157 | help='Request reviews from these people.') |
@@ -420,6 +423,8 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
420 | hashtags = set(_ExpandHashtag(branch.project.config.GetString(key))) | 423 | hashtags = set(_ExpandHashtag(branch.project.config.GetString(key))) |
421 | for tag in opt.hashtags: | 424 | for tag in opt.hashtags: |
422 | hashtags.update(_ExpandHashtag(tag)) | 425 | hashtags.update(_ExpandHashtag(tag)) |
426 | if opt.hashtag_branch: | ||
427 | hashtags.add(branch.name) | ||
423 | 428 | ||
424 | destination = opt.dest_branch or branch.project.dest_branch | 429 | destination = opt.dest_branch or branch.project.dest_branch |
425 | 430 | ||