Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 13912:71ea5b2b9517 stable
subrepo: prevent url normalization from removing // in ssh paths (issue2556)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 07 Apr 2011 12:33:47 +0200 |
parents | a7c9735307bd |
children | d3f90ff904b8 1052b1421a48 |
comparison
equal
deleted
inserted
replaced
13905:08d49b6b8d32 | 13912:71ea5b2b9517 |
---|---|
200 if parent: | 200 if parent: |
201 if '://' in parent: | 201 if '://' in parent: |
202 if parent[-1] == '/': | 202 if parent[-1] == '/': |
203 parent = parent[:-1] | 203 parent = parent[:-1] |
204 r = urlparse.urlparse(parent + '/' + source) | 204 r = urlparse.urlparse(parent + '/' + source) |
205 r = urlparse.urlunparse((r[0], r[1], | 205 if parent.startswith('ssh://'): |
206 posixpath.normpath(r[2]), | 206 host, path = r[2][2:].split('/', 1) |
207 r2 = '//%s/%s' % (host, posixpath.normpath(path)) | |
208 else: | |
209 r2 = posixpath.normpath(r[2]) | |
210 r = urlparse.urlunparse((r[0], r[1], r2, | |
207 r[3], r[4], r[5])) | 211 r[3], r[4], r[5])) |
208 return r | 212 return r |
209 else: # plain file system path | 213 else: # plain file system path |
210 return posixpath.normpath(os.path.join(parent, repo._subsource)) | 214 return posixpath.normpath(os.path.join(parent, repo._subsource)) |
211 else: # recursion reached top repo | 215 else: # recursion reached top repo |