mercurial/subrepo.py
branchstable
changeset 21568 8dd17b19e722
parent 21567 5900bc09e684
child 21585 652e07debf10
equal deleted inserted replaced
21567:5900bc09e684 21568:8dd17b19e722
   274 def reporelpath(repo):
   274 def reporelpath(repo):
   275     """return path to this (sub)repo as seen from outermost repo"""
   275     """return path to this (sub)repo as seen from outermost repo"""
   276     parent = repo
   276     parent = repo
   277     while util.safehasattr(parent, '_subparent'):
   277     while util.safehasattr(parent, '_subparent'):
   278         parent = parent._subparent
   278         parent = parent._subparent
   279     p = parent.root.rstrip(os.sep)
   279     return repo.root[len(pathutil.normasprefix(parent.root)):]
   280     return repo.root[len(p) + 1:]
       
   281 
   280 
   282 def subrelpath(sub):
   281 def subrelpath(sub):
   283     """return path to this subrepo as seen from outermost repo"""
   282     """return path to this subrepo as seen from outermost repo"""
   284     if util.safehasattr(sub, '_relpath'):
   283     if util.safehasattr(sub, '_relpath'):
   285         return sub._relpath
   284         return sub._relpath