diff options
| author | Bryan Jacobs <bryanrj@gmail.com> | 2013-05-06 13:36:24 -0400 |
|---|---|---|
| committer | Bryan Jacobs <bryanrj@gmail.com> | 2013-05-24 12:17:22 -0400 |
| commit | f609f91b72c0b90026da0eefcc0f52f12840971b (patch) | |
| tree | 819e244e52279d7b232df5e17727a9a828ddda66 /subcmds/upload.py | |
| parent | 59bbb580e34bbc5dce76dacaad9ff94f21fa396f (diff) | |
| download | git-repo-f609f91b72c0b90026da0eefcc0f52f12840971b.tar.gz | |
Send reviews to a different branch from fetch
This adds the ability to have reviews pushed to a different branch
from the one on which changes are based. This is useful for "gateway"
systems without smartsync.
Change-Id: I3a8a0fabcaf6055e62d3fb55f89c944e2f81569f
Diffstat (limited to 'subcmds/upload.py')
| -rw-r--r-- | subcmds/upload.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 13b87784..4a22e26a 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -146,6 +146,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 146 | p.add_option('-d', '--draft', | 146 | p.add_option('-d', '--draft', |
| 147 | action='store_true', dest='draft', default=False, | 147 | action='store_true', dest='draft', default=False, |
| 148 | help='If specified, upload as a draft.') | 148 | help='If specified, upload as a draft.') |
| 149 | p.add_option('-D', '--destination', '--dest', | ||
| 150 | type='string', action='store', dest='dest_branch', | ||
| 151 | metavar='BRANCH', | ||
| 152 | help='Submit for review on this target branch.') | ||
| 149 | 153 | ||
| 150 | # Options relating to upload hook. Note that verify and no-verify are NOT | 154 | # Options relating to upload hook. Note that verify and no-verify are NOT |
| 151 | # opposites of each other, which is why they store to different locations. | 155 | # opposites of each other, which is why they store to different locations. |
| @@ -185,7 +189,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 185 | date = branch.date | 189 | date = branch.date |
| 186 | commit_list = branch.commits | 190 | commit_list = branch.commits |
| 187 | 191 | ||
| 188 | print('Upload project %s/ to remote branch %s:' % (project.relpath, project.revisionExpr)) | 192 | destination = project.dest_branch or project.revisionExpr |
| 193 | print('Upload project %s/ to remote branch %s:' % (project.relpath, destination)) | ||
| 189 | print(' branch %s (%2d commit%s, %s):' % ( | 194 | print(' branch %s (%2d commit%s, %s):' % ( |
| 190 | name, | 195 | name, |
| 191 | len(commit_list), | 196 | len(commit_list), |
| @@ -336,7 +341,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 336 | key = 'review.%s.uploadtopic' % branch.project.remote.review | 341 | key = 'review.%s.uploadtopic' % branch.project.remote.review |
| 337 | opt.auto_topic = branch.project.config.GetBoolean(key) | 342 | opt.auto_topic = branch.project.config.GetBoolean(key) |
| 338 | 343 | ||
| 339 | branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft) | 344 | branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=opt.dest_branch) |
| 340 | branch.uploaded = True | 345 | branch.uploaded = True |
| 341 | except UploadError as e: | 346 | except UploadError as e: |
| 342 | branch.error = e | 347 | branch.error = e |
