summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Escande <wescande@google.com>2022-08-02 16:05:37 -0700
committerWilliam Escande <wescande@google.com>2022-08-03 20:17:06 +0000
commitac76fd3e3a08024493f28913ec0c9660282d5f5b (patch)
tree61ec745cf2eb6d04e8d29bf4ad7fee6542c6714b
parenta8c34d1075123ca58f56cc93e9564efdb13292b2 (diff)
downloadgit-repo-ac76fd3e3a08024493f28913ec0c9660282d5f5b.tar.gz
upload: Add ready flag to remove wip
The `--wip` allow to bulk push changed as work-in-progress. This CL intend to allow the opposite opperation by removing the wip mark on the CL and set it to be ready to review Change-Id: If0743c5b14829f77be2def5a8547060d06a5648c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/342214 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: William Escande <wescande@google.com>
-rw-r--r--project.py5
-rw-r--r--subcmds/upload.py4
2 files changed, 9 insertions, 0 deletions
diff --git a/project.py b/project.py
index f9524a09..07102d42 100644
--- a/project.py
+++ b/project.py
@@ -205,6 +205,7 @@ class ReviewableBranch(object):
205 private=False, 205 private=False,
206 notify=None, 206 notify=None,
207 wip=False, 207 wip=False,
208 ready=False,
208 dest_branch=None, 209 dest_branch=None,
209 validate_certs=True, 210 validate_certs=True,
210 push_options=None): 211 push_options=None):
@@ -217,6 +218,7 @@ class ReviewableBranch(object):
217 private=private, 218 private=private,
218 notify=notify, 219 notify=notify,
219 wip=wip, 220 wip=wip,
221 ready=ready,
220 dest_branch=dest_branch, 222 dest_branch=dest_branch,
221 validate_certs=validate_certs, 223 validate_certs=validate_certs,
222 push_options=push_options) 224 push_options=push_options)
@@ -1003,6 +1005,7 @@ class Project(object):
1003 private=False, 1005 private=False,
1004 notify=None, 1006 notify=None,
1005 wip=False, 1007 wip=False,
1008 ready=False,
1006 dest_branch=None, 1009 dest_branch=None,
1007 validate_certs=True, 1010 validate_certs=True,
1008 push_options=None): 1011 push_options=None):
@@ -1072,6 +1075,8 @@ class Project(object):
1072 opts += ['private'] 1075 opts += ['private']
1073 if wip: 1076 if wip:
1074 opts += ['wip'] 1077 opts += ['wip']
1078 if ready:
1079 opts += ['ready']
1075 if opts: 1080 if opts:
1076 ref_spec = ref_spec + '%' + ','.join(opts) 1081 ref_spec = ref_spec + '%' + ','.join(opts)
1077 cmd.append(ref_spec) 1082 cmd.append(ref_spec)
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 09ee5c02..01d1dea4 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -190,6 +190,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/
190 p.add_option('-w', '--wip', 190 p.add_option('-w', '--wip',
191 action='store_true', dest='wip', default=False, 191 action='store_true', dest='wip', default=False,
192 help='upload as a work-in-progress change') 192 help='upload as a work-in-progress change')
193 p.add_option('-r', '--ready',
194 action='store_true', default=False,
195 help='mark change as ready (clears work-in-progress setting)')
193 p.add_option('-o', '--push-option', 196 p.add_option('-o', '--push-option',
194 type='string', action='append', dest='push_options', 197 type='string', action='append', dest='push_options',
195 default=[], 198 default=[],
@@ -465,6 +468,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
465 private=opt.private, 468 private=opt.private,
466 notify=notify, 469 notify=notify,
467 wip=opt.wip, 470 wip=opt.wip,
471 ready=opt.ready,
468 dest_branch=destination, 472 dest_branch=destination,
469 validate_certs=opt.validate_certs, 473 validate_certs=opt.validate_certs,
470 push_options=opt.push_options) 474 push_options=opt.push_options)