[PATCH 05 of 13 V2] localrepo: refactor repo.branchtip() to use repo.branchmap().branchtip()
Brodie Rao
brodie at sf.io
Sat Nov 16 04:18:49 UTC 2013
# HG changeset patch
# User Brodie Rao <brodie at sf.io>
# Date 1379318909 25200
# Mon Sep 16 01:08:29 2013 -0700
# Node ID 6b2a5372b1bbffa4eac972e49d15f2283b5c2dd7
# Parent 0ed65d30c55d995856a92667c3eddaede742c47c
localrepo: refactor repo.branchtip() to use repo.branchmap().branchtip()
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -666,9 +666,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
More information about the Mercurial-devel
mailing list