##// END OF EJS Templates
subrepo: backout 93b0e0db7929 to restore reporelpath()...
Matt Harbison -
r24785:39f519be default
parent child Browse files
Show More
@@ -271,6 +271,13 b' def _updateprompt(ui, sub, dirty, local,'
271 % (subrelpath(sub), local, remote))
271 % (subrelpath(sub), local, remote))
272 return ui.promptchoice(msg, 0)
272 return ui.promptchoice(msg, 0)
273
273
274 def reporelpath(repo):
275 """return path to this (sub)repo as seen from outermost repo"""
276 parent = repo
277 while util.safehasattr(parent, '_subparent'):
278 parent = parent._subparent
279 return repo.root[len(pathutil.normasprefix(parent.root)):]
280
274 def subrelpath(sub):
281 def subrelpath(sub):
275 """return path to this subrepo as seen from outermost repo"""
282 """return path to this subrepo as seen from outermost repo"""
276 return sub._relpath
283 return sub._relpath
@@ -551,13 +558,7 b' class abstractsubrepo(object):'
551 def _relpath(self):
558 def _relpath(self):
552 """return path to this subrepository as seen from outermost repository
559 """return path to this subrepository as seen from outermost repository
553 """
560 """
554 repo = self._ctx.repo()
561 return self.wvfs.reljoin(reporelpath(self._ctx.repo()), self._path)
555 parent = repo
556 while util.safehasattr(parent, '_subparent'):
557 parent = parent._subparent
558 reporelpath = repo.root[len(pathutil.normasprefix(parent.root)):]
559
560 return self.wvfs.reljoin(reporelpath, self._path)
561
562
562 class hgsubrepo(abstractsubrepo):
563 class hgsubrepo(abstractsubrepo):
563 def __init__(self, ctx, path, state):
564 def __init__(self, ctx, path, state):
General Comments 0
You need to be logged in to leave comments. Login now