summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py13
-rw-r--r--subcmds/upload.py7
2 files changed, 16 insertions, 4 deletions
diff --git a/project.py b/project.py
index e1a844e7..83dcf551 100644
--- a/project.py
+++ b/project.py
@@ -180,7 +180,8 @@ class ReviewableBranch(object):
180 private=False, 180 private=False,
181 wip=False, 181 wip=False,
182 dest_branch=None, 182 dest_branch=None,
183 validate_certs=True): 183 validate_certs=True,
184 push_options=None):
184 self.project.UploadForReview(self.name, 185 self.project.UploadForReview(self.name,
185 people, 186 people,
186 auto_topic=auto_topic, 187 auto_topic=auto_topic,
@@ -188,7 +189,8 @@ class ReviewableBranch(object):
188 private=private, 189 private=private,
189 wip=wip, 190 wip=wip,
190 dest_branch=dest_branch, 191 dest_branch=dest_branch,
191 validate_certs=validate_certs) 192 validate_certs=validate_certs,
193 push_options=push_options)
192 194
193 def GetPublishedRefs(self): 195 def GetPublishedRefs(self):
194 refs = {} 196 refs = {}
@@ -1117,7 +1119,8 @@ class Project(object):
1117 private=False, 1119 private=False,
1118 wip=False, 1120 wip=False,
1119 dest_branch=None, 1121 dest_branch=None,
1120 validate_certs=True): 1122 validate_certs=True,
1123 push_options=None):
1121 """Uploads the named branch for code review. 1124 """Uploads the named branch for code review.
1122 """ 1125 """
1123 if branch is None: 1126 if branch is None:
@@ -1155,6 +1158,10 @@ class Project(object):
1155 rp.append('--cc=%s' % sq(e)) 1158 rp.append('--cc=%s' % sq(e))
1156 cmd.append('--receive-pack=%s' % " ".join(rp)) 1159 cmd.append('--receive-pack=%s' % " ".join(rp))
1157 1160
1161 for push_option in (push_options or []):
1162 cmd.append('-o')
1163 cmd.append(push_option)
1164
1158 cmd.append(url) 1165 cmd.append(url)
1159 1166
1160 if dest_branch.startswith(R_HEADS): 1167 if dest_branch.startswith(R_HEADS):
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 60feff7a..77eaf81a 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -160,6 +160,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
160 p.add_option('-w', '--wip', 160 p.add_option('-w', '--wip',
161 action='store_true', dest='wip', default=False, 161 action='store_true', dest='wip', default=False,
162 help='If specified, upload as a work-in-progress change.') 162 help='If specified, upload as a work-in-progress change.')
163 p.add_option('-o', '--push-option',
164 type='string', action='append', dest='push_options',
165 default=[],
166 help='Additional push options to transmit')
163 p.add_option('-D', '--destination', '--dest', 167 p.add_option('-D', '--destination', '--dest',
164 type='string', action='store', dest='dest_branch', 168 type='string', action='store', dest='dest_branch',
165 metavar='BRANCH', 169 metavar='BRANCH',
@@ -393,7 +397,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
393 private=opt.private, 397 private=opt.private,
394 wip=opt.wip, 398 wip=opt.wip,
395 dest_branch=destination, 399 dest_branch=destination,
396 validate_certs=opt.validate_certs) 400 validate_certs=opt.validate_certs,
401 push_options=opt.push_options)
397 402
398 branch.uploaded = True 403 branch.uploaded = True
399 except UploadError as e: 404 except UploadError as e: