Commit f04a6e6c authored by tandrii@chromium.org's avatar tandrii@chromium.org

git cl upload: print patchset when uploading to Rietvled.

R=andybons@chromium.org,phajdan@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1772293003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299174 0039d316-1c4b-4281-b951-d872f2087c98
parent 151ebcff
......@@ -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
if not uploaded_diff_file:
result = UploadSeparatePatches(issue, rpc_server, patchset, data, options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment