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

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 4:18 a.m.
Message ID <6a1b9fdf04b4570654cb.1384575537@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2989/
State Accepted
Commit 4274eda143cb1025be1130ffdaaf62370a2a6961
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 4:18 a.m.
# HG changeset patch
# User Brodie Rao <brodie@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
Matt Mackall - Dec. 20, 2013, 9:23 p.m.
On Fri, 2013-11-15 at 23:18 -0500, Brodie Rao wrote:
> # HG changeset patch
> # User Brodie Rao <brodie@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

These are queued for default, thanks for your patience.

Patch

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()