Chromium Code Reviews| Index: third_party/upload.py |
| diff --git a/third_party/upload.py b/third_party/upload.py |
| index ec6a588ba4a62755f3c6a2dde3af51a2b18afad3..befdf52dfa0aa0083677e3d3e444282a8c5f8792 100755 |
| --- a/third_party/upload.py |
| +++ b/third_party/upload.py |
| @@ -2484,12 +2484,15 @@ def RealMain(argv, data=None): |
| uploaded_diff_file = [("data", "data.diff", data)] |
| ctype, body = EncodeMultipartFormData(form_fields, uploaded_diff_file) |
| response_body = rpc_server.Send("/upload", body, content_type=ctype) |
| - patchset = None |
| + issue, patchset = None, None |
| if not options.download_base or not uploaded_diff_file: |
| lines = response_body.splitlines() |
| if len(lines) >= 2: |
| - msg = lines[0] |
| + # lines[0] is "Issue (created|updated): <url>". |
| + issue = lines[0][lines[0].rfind("/")+1:] |
| + # lines[1] is just patchset number. |
| patchset = lines[1].strip() |
| + msg = '%s (patchset: %s)' % (lines[0], patchset) |
| patches = [x.split(" ", 1) for x in lines[2:]] |
| else: |
| msg = response_body |
| @@ -2499,7 +2502,7 @@ def RealMain(argv, data=None): |
| if not response_body.startswith("Issue created.") and \ |
| not response_body.startswith("Issue updated."): |
| sys.exit(0) |
| - issue = msg[msg.rfind("/")+1:] |
| + assert issue |
|
Bons
2016/03/08 18:48:22
this is meant to be in here?
tandrii(chromium)
2016/03/08 19:02:47
Yes, as I slightly changed logical conditions from
|
| if not uploaded_diff_file: |
| result = UploadSeparatePatches(issue, rpc_server, patchset, data, options) |