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

Unified Diff: git_cl.py

Issue 2215433004: Extract patchset in Rietveld URLs better (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 4 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 | tests/git_cl_test.py » ('j') | 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 7199f260d6a43e5e69862d610f9ea40549c28194..1726fd4ad22ace1825cde8febcf261c029b5ab0c 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1866,6 +1866,14 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
def ParseIssueURL(parsed_url):
if not parsed_url.scheme or not parsed_url.scheme.startswith('http'):
return None
+ # Rietveld patch: https://domain/<number>/#ps<patchset>
+ match = re.match(r'/(\d+)/$', parsed_url.path)
+ match2 = re.match(r'ps(\d+)$', parsed_url.fragment)
+ if match and match2:
+ return _RietveldParsedIssueNumberArgument(
+ issue=int(match.group(1)),
+ patchset=int(match2.group(1)),
+ hostname=parsed_url.netloc)
# Typical url: https://domain/<issue_number>[/[other]]
match = re.match('/(\d+)(/.*)?$', parsed_url.path)
if match:
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698