Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 15208:d0694223861a
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 07 Oct 2011 17:22:12 -0500 |
parents | 6dc67dced8c1 fccd350acf79 |
children | 5d700b7edd85 |
comparison
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 |