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

Unified Diff: git_cl.py

Issue 1166673002: Fix bug in git cl patch using raw patch URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Parsing Rietveld server for raw patch instead Created 5 years, 7 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: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 8cc37bf589eba07923e273d6578a3d7e0f8597f3..ce365419b279a84dd43970244e43942b09515262 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -318,7 +318,7 @@ def trigger_try_jobs(auth_config, changelist, options, masters, category,
time.sleep(0.5 + 1.5*try_count)
print '\n'.join(print_text)
-
+
def MatchSvnGlob(url, base_url, glob_spec, allow_wildcards):
"""Return the corresponding git ref if |base_url| together with |glob_spec|
@@ -2720,12 +2720,14 @@ def PatchIssue(issue_arg, reject, nocommit, directory, auth_config):
else:
# Assume it's a URL to the patch. Default to https.
issue_url = gclient_utils.UpgradeToHttps(issue_arg)
- match = re.match(r'.*?/issue(\d+)_(\d+).diff', issue_url)
+ match = re.match(r'(.*?)/download/issue(\d+)_(\d+).diff', issue_url)
if not match:
DieWithError('Must pass an issue ID or full URL for '
'\'Download raw patch set\'')
- issue = int(match.group(1))
- patchset = int(match.group(2))
+ issue = int(match.group(2))
+ cl = Changelist(issue=issue, auth_config=auth_config)
+ cl.rietveld_server = match.group(1)
+ patchset = int(match.group(3))
patch_data = urllib2.urlopen(issue_arg).read()
# Switch up to the top-level directory, if necessary, in preparation for
« 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