mercurial/subrepo.py
changeset 15208 d0694223861a
parent 15190 6dc67dced8c1
parent 15191 fccd350acf79
child 15234 5d700b7edd85
equal deleted inserted replaced
15207:0f7f9f06c759 15208:d0694223861a
   200 def reporelpath(repo):
   200 def reporelpath(repo):
   201     """return path to this (sub)repo as seen from outermost repo"""
   201     """return path to this (sub)repo as seen from outermost repo"""
   202     parent = repo
   202     parent = repo
   203     while util.safehasattr(parent, '_subparent'):
   203     while util.safehasattr(parent, '_subparent'):
   204         parent = parent._subparent
   204         parent = parent._subparent
   205     return repo.root[len(parent.root)+1:]
   205     p = parent.root.rstrip(os.sep)
       
   206     return repo.root[len(p) + 1:]
   206 
   207 
   207 def subrelpath(sub):
   208 def subrelpath(sub):
   208     """return path to this subrepo as seen from outermost repo"""
   209     """return path to this subrepo as seen from outermost repo"""
   209     if util.safehasattr(sub, '_relpath'):
   210     if util.safehasattr(sub, '_relpath'):
   210         return sub._relpath
   211         return sub._relpath