comparison mercurial/subrepo.py @ 14766:4f56b7530eab stable

subrepos: be smarter about what's an absolute path (issue2808)
author Matt Mackall <mpm@selenic.com>
date Wed, 29 Jun 2011 16:01:06 -0500
parents 0ae98cd2a83f
children 7ef125fa9b35
comparison
equal deleted inserted replaced
14765:08ef6b5f3715 14766:4f56b7530eab
196 def _abssource(repo, push=False, abort=True): 196 def _abssource(repo, push=False, abort=True):
197 """return pull/push path of repo - either based on parent repo .hgsub info 197 """return pull/push path of repo - either based on parent repo .hgsub info
198 or on the top repo config. Abort or return None if no source found.""" 198 or on the top repo config. Abort or return None if no source found."""
199 if hasattr(repo, '_subparent'): 199 if hasattr(repo, '_subparent'):
200 source = util.url(repo._subsource) 200 source = util.url(repo._subsource)
201 if source.isabs():
202 return str(source)
201 source.path = posixpath.normpath(source.path) 203 source.path = posixpath.normpath(source.path)
202 if posixpath.isabs(source.path) or source.scheme:
203 return str(source)
204 parent = _abssource(repo._subparent, push, abort=False) 204 parent = _abssource(repo._subparent, push, abort=False)
205 if parent: 205 if parent:
206 parent = util.url(parent) 206 parent = util.url(parent)
207 parent.path = posixpath.join(parent.path, source.path) 207 parent.path = posixpath.join(parent.path, source.path)
208 parent.path = posixpath.normpath(parent.path) 208 parent.path = posixpath.normpath(parent.path)