Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 14205:7b627923739f stable
subrepo: use code from 71ea5b2b9517 only if Python needs it (issue2795)
With Python >= 2.6 the original code already works correct, therefore the
fix for issue2556 on Python <= 2.5 broke relative subrepositories with
newer versions of Python.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 05 May 2011 16:01:09 +0200 |
parents | 9e8a9d45945c |
children | 680c3c6fcb48 2fdea636f254 |
comparison
equal
deleted
inserted
replaced
14170:31ec4d7eb63f | 14205:7b627923739f |
---|---|
201 if parent: | 201 if parent: |
202 if '://' in parent: | 202 if '://' in parent: |
203 if parent[-1] == '/': | 203 if parent[-1] == '/': |
204 parent = parent[:-1] | 204 parent = parent[:-1] |
205 r = urlparse.urlparse(parent + '/' + source) | 205 r = urlparse.urlparse(parent + '/' + source) |
206 if parent.startswith('ssh://'): | 206 if parent.startswith('ssh://') and not r[1]: |
207 # Python before 2.6 parses ssh:// URLs wrong | |
207 host, path = r[2][2:].split('/', 1) | 208 host, path = r[2][2:].split('/', 1) |
208 r2 = '//%s/%s' % (host, posixpath.normpath(path)) | 209 r2 = '//%s/%s' % (host, posixpath.normpath(path)) |
209 else: | 210 else: |
210 r2 = posixpath.normpath(r[2]) | 211 r2 = posixpath.normpath(r[2]) |
211 r = urlparse.urlunparse((r[0], r[1], r2, | 212 r = urlparse.urlunparse((r[0], r[1], r2, |