diff options
| author | Joe Onorato <joeo@android.com> | 2008-11-17 16:56:36 -0500 |
|---|---|---|
| committer | Joe Onorato <joeo@android.com> | 2008-11-19 11:55:06 -0500 |
| commit | 2896a79120fe1de65472736f756c47b558b44db1 (patch) | |
| tree | 73a105ae2e3138575b82e9840a69c8b2eca0dd1e /gerrit_upload.py | |
| parent | 8c6eef4713db36a2063dd5a68b3d37a5e4276508 (diff) | |
| download | git-repo-2896a79120fe1de65472736f756c47b558b44db1.tar.gz | |
Add --review and --cc flags to repo upload, so you can
assign reviewers when you upload changes.
Diffstat (limited to 'gerrit_upload.py')
| -rwxr-xr-x | gerrit_upload.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gerrit_upload.py b/gerrit_upload.py index d3d4ff3e..17112aac 100755 --- a/gerrit_upload.py +++ b/gerrit_upload.py | |||
| @@ -75,6 +75,7 @@ def UploadBundle(project, | |||
| 75 | dest_branch, | 75 | dest_branch, |
| 76 | src_branch, | 76 | src_branch, |
| 77 | bases, | 77 | bases, |
| 78 | people, | ||
| 78 | replace_changes = None, | 79 | replace_changes = None, |
| 79 | save_cookies=True): | 80 | save_cookies=True): |
| 80 | 81 | ||
| @@ -112,6 +113,10 @@ def UploadBundle(project, | |||
| 112 | req = UploadBundleRequest() | 113 | req = UploadBundleRequest() |
| 113 | req.dest_project = str(dest_project) | 114 | req.dest_project = str(dest_project) |
| 114 | req.dest_branch = str(dest_branch) | 115 | req.dest_branch = str(dest_branch) |
| 116 | for e in people[0]: | ||
| 117 | req.reviewers.append(e) | ||
| 118 | for e in people[1]: | ||
| 119 | req.cc.append(e) | ||
| 115 | for c in revlist: | 120 | for c in revlist: |
| 116 | req.contained_object.append(c) | 121 | req.contained_object.append(c) |
| 117 | if replace_changes: | 122 | if replace_changes: |
| @@ -158,6 +163,10 @@ def UploadBundle(project, | |||
| 158 | reason = 'invalid change id' | 163 | reason = 'invalid change id' |
| 159 | elif rsp.status_code == UploadBundleResponse.CHANGE_CLOSED: | 164 | elif rsp.status_code == UploadBundleResponse.CHANGE_CLOSED: |
| 160 | reason = 'one or more changes are closed' | 165 | reason = 'one or more changes are closed' |
| 166 | elif rsp.status_code == UploadBundleResponse.UNKNOWN_EMAIL: | ||
| 167 | emails = [x for x in rsp.invalid_reviewers] + [ | ||
| 168 | x for x in rsp.invalid_cc] | ||
| 169 | reason = 'invalid email addresses: %s' % ", ".join(emails) | ||
| 161 | else: | 170 | else: |
| 162 | reason = 'unknown error ' + str(rsp.status_code) | 171 | reason = 'unknown error ' + str(rsp.status_code) |
| 163 | raise UploadError(reason) | 172 | raise UploadError(reason) |
