[PATCH 13 of 13 V2] localrepo: remove unused repo.branchtags()/_branchtip() methods

Brodie Rao brodie at sf.io
Fri Nov 15 22:18:57 CST 2013


# HG changeset patch
# User Brodie Rao <brodie at sf.io>
# Date 1379318909 25200
#      Mon Sep 16 01:08:29 2013 -0700
# Node ID 6a1b9fdf04b4570654cb1f3c5469e84b427c7543
# Parent  68335bcdcc009850a38f8a7c17e4f8f080158f02
localrepo: remove unused repo.branchtags()/_branchtip() methods

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -654,16 +654,6 @@ class localrepository(object):
         branchmap.updatecache(self)
         return self._branchcaches[self.filtername]
 
-
-    def _branchtip(self, heads):
-        '''return the tipmost branch head in heads'''
-        tip = heads[-1]
-        for h in reversed(heads):
-            if not self[h].closesbranch():
-                tip = h
-                break
-        return tip
-
     def branchtip(self, branch):
         '''return the tip node for a given branch'''
         try:
@@ -671,14 +661,6 @@ class localrepository(object):
         except KeyError:
             raise error.RepoLookupError(_("unknown branch '%s'") % branch)
 
-    def branchtags(self):
-        '''return a dict where branch names map to the tipmost head of
-        the branch, open heads come before closed'''
-        bt = {}
-        for bn, heads in self.branchmap().iteritems():
-            bt[bn] = self._branchtip(heads)
-        return bt
-
     def lookup(self, key):
         return self[key].node()
 


More information about the Mercurial-devel mailing list