mercurial/subrepo.py
branchstable
changeset 15191 fccd350acf79
parent 15055 d629f1e89021
child 15208 d0694223861a
equal deleted inserted replaced
15186:a9b0f5624ffc 15191:fccd350acf79
   181 def reporelpath(repo):
   181 def reporelpath(repo):
   182     """return path to this (sub)repo as seen from outermost repo"""
   182     """return path to this (sub)repo as seen from outermost repo"""
   183     parent = repo
   183     parent = repo
   184     while hasattr(parent, '_subparent'):
   184     while hasattr(parent, '_subparent'):
   185         parent = parent._subparent
   185         parent = parent._subparent
   186     return repo.root[len(parent.root)+1:]
   186     p = parent.root.rstrip(os.sep)
       
   187     return repo.root[len(p) + 1:]
   187 
   188 
   188 def subrelpath(sub):
   189 def subrelpath(sub):
   189     """return path to this subrepo as seen from outermost repo"""
   190     """return path to this subrepo as seen from outermost repo"""
   190     if hasattr(sub, '_relpath'):
   191     if hasattr(sub, '_relpath'):
   191         return sub._relpath
   192         return sub._relpath