From 7780c28b922de1a05469834752ed59e16f269735 Mon Sep 17 00:00:00 2001 From: "msb@chromium.org" Date: Mon, 9 Nov 2009 17:54:17 +0000 Subject: [PATCH] gclient: fix bug where ssh urls with a username weren't parse correctly ssh://test@example.org/test.git was not parsed correctly because we would split at the '@' assuming what followed was a revision. Review URL: http://codereview.chromium.org/372045 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31444 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gclient_scm.py b/gclient_scm.py index ab381bf8a..ea8e36b14 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 = r"(ssh://(?:[\w]+@)?[-\w:\.]+/[-\w\.]+)(?:@([\w/]+))?" + components = re.search(regex, self.url).groups() + else: + components = self.url.split("@") url = components[0] revision = None if options.revision: