Patchwork [06,of,12] localrepo: refactor repo.branchheads() to use repo.branchmap().branchheads()

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 2:27 a.m.
Message ID <9a6a65043164e404bf24.1384568858@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2964/
State Superseded
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 2:27 a.m.
# HG changeset patch
# User Brodie Rao <brodie@sf.io>
# Date 1379318909 25200
#      Mon Sep 16 01:08:29 2013 -0700
# Node ID 9a6a65043164e404bf24d1b9b419f6cefe8b883a
# Parent  7b9b47384721d01206f4bed187374f48b03e742d
localrepo: refactor repo.branchheads() to use repo.branchmap().branchheads()

Patch

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