Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: third_party/upload.py

Issue 1772293003: git cl upload: print patchset when uploading to Rietvled. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: ps2-just-test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698