# HG changeset patch # User Brodie Rao # Date 1379318909 25200 # Node ID 4d6d5ef885384feb3178e9d799e4b22da3b1e7d0 # Parent f5b461a4bc55fe88df0a04cc2f58fb336f8d03aa localrepo: refactor repo.branchtip() to use repo.branchmap().branchtip() diff -r f5b461a4bc55 -r 4d6d5ef88538 mercurial/localrepo.py --- 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