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

Unified Diff: gclient_scm.py

Issue 372045: gclient: fix bug where ssh urls with a username weren't parse correctly (Closed)
Patch Set: Created 11 years, 1 month 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: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index ab381bf8a48d8ad3cd43a59133c7080ef3774a9b..00f8cd069a42d6bec7a4860ab582bbc2cacff955 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -125,7 +125,12 @@ class GitWrapper(SCMWrapper):
if args:
raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args))
- components = self.url.split("@")
+ if self.url.startswith('ssh:'):
+ # Make sure ssh://test@example.com/test.git@stable works
+ regex = "(ssh://(?:[\w]+@)?[-\w:\.]+/[-\w\.]+)(?:@([\w/]+))?"
M-A Ruel 2009/11/07 19:29:40 Doesn't the regex work with svn url? If so, no nee
M-A Ruel 2009/11/09 16:39:24 You need to use r"" btw.
+ components = re.search(regex, self.url).groups()
+ else:
+ components = self.url.split("@")
url = components[0]
revision = None
if options.revision:
« 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