localrepo: refactor repo.branchtip() to use repo.branchmap().branchtip()

This commit is contained in:
Brodie Rao 2013-09-16 01:08:29 -07:00
parent b2b08444eb
commit b351ef136e

View File

@ -671,9 +671,10 @@ class localrepository(object):
def branchtip(self, branch):
'''return the tip node for a given branch'''
if branch not in self.branchmap():
try:
return self.branchmap().branchtip(branch)
except KeyError:
raise error.RepoLookupError(_("unknown branch '%s'") % branch)
return self._branchtip(self.branchmap()[branch])
def branchtags(self):
'''return a dict where branch names map to the tipmost head of