comparison mercurial/localrepo.py @ 20187:4d6d5ef88538

localrepo: refactor repo.branchtip() to use repo.branchmap().branchtip()
author Brodie Rao <brodie@sf.io>
date Mon, 16 Sep 2013 01:08:29 -0700
parents a14d93b2fb1b
children 1831993d0902
comparison
equal deleted inserted replaced
20186:f5b461a4bc55 20187:4d6d5ef88538
669 break 669 break
670 return tip 670 return tip
671 671
672 def branchtip(self, branch): 672 def branchtip(self, branch):
673 '''return the tip node for a given branch''' 673 '''return the tip node for a given branch'''
674 if branch not in self.branchmap(): 674 try:
675 return self.branchmap().branchtip(branch)
676 except KeyError:
675 raise error.RepoLookupError(_("unknown branch '%s'") % branch) 677 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
676 return self._branchtip(self.branchmap()[branch])
677 678
678 def branchtags(self): 679 def branchtags(self):
679 '''return a dict where branch names map to the tipmost head of 680 '''return a dict where branch names map to the tipmost head of
680 the branch, open heads come before closed''' 681 the branch, open heads come before closed'''
681 bt = {} 682 bt = {}