comparison mercurial/subrepo.py @ 15191:fccd350acf79 stable

subrepo: fix repo relative path calculation for root directories (issue3033)
author Matt Mackall <mpm@selenic.com>
date Sun, 02 Oct 2011 16:41:07 -0500
parents d629f1e89021
children d0694223861a
comparison
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