mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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
This commit is contained in:
@@ -107,8 +107,8 @@ def CheckCall(command, print_error=True, **kwargs):
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user