[PATCH 07 of 13 V2] localrepo: refactor repo.branchheads() to use repo.branchmap().branchheads()

Brodie Rao brodie at sf.io
Fri Nov 15 22:18:51 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 4adc456149d0769612ef703d3a2db56e650042e0
# Parent  6f437923d70ead5e8bb7aa18177a8cb2968332cd
localrepo: refactor repo.branchheads() to use repo.branchmap().branchheads()

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1622,13 +1622,11 @@ class localrepository(object):
         if branch not in branches:
             return []
         # the cache returns heads ordered lowest to highest
-        bheads = list(reversed(branches[branch]))
+        bheads = list(reversed(branches.branchheads(branch, closed=closed)))
         if start is not None:
             # filter out the heads that cannot be reached from startrev
             fbheads = set(self.changelog.nodesbetween([start], bheads)[2])
             bheads = [h for h in bheads if h in fbheads]
-        if not closed:
-            bheads = [h for h in bheads if not self[h].closesbranch()]
         return bheads
 
     def branches(self, nodes):


More information about the Mercurial-devel mailing list