changeset 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 f5b461a4bc55
children 3a3727829607
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Sep 16 01:08:29 2013 -0700
+++ b/mercurial/localrepo.py	Mon Sep 16 01:08:29 2013 -0700
@@ -671,9 +671,10 @@
 
     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