gclient can now handle git URLs containing "-" in usernames and "~" in paths.
Contributed by Torsten Becker <torsten.becker@gmail.com>
BUG=
TEST=gclient config 'ssh://user-name@asd.com/~/asd.git' && gclient sync # fails in SplitUrlRevision
Review URL: http://codereview.chromium.org/4144002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63877 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_utils.py b/gclient_utils.py
index 743e57b..4c74c5c 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -107,8 +107,8 @@
def SplitUrlRevision(url):
"""Splits url and returns a two-tuple: url, rev"""
if url.startswith('ssh:'):
- # Make sure ssh://test@example.com/test.git@stable works
- regex = r'(ssh://(?:[\w]+@)?[-\w:\.]+/[-\w\./]+)(?:@(.+))?'
+ # Make sure ssh://user-name@example.com/~/test.git@stable works
+ regex = r'(ssh://(?:[-\w]+@)?[-\w:\.]+/[-~\w\./]+)(?:@(.+))?'
components = re.search(regex, url).groups()
else:
components = url.split('@', 1)