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

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 4:18 a.m.
Message ID <4adc456149d0769612ef.1384575531@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2983/
State Accepted
Commit 1831993d090249b591251fb9aad35fab8161d928
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 4adc456149d0769612ef703d3a2db56e650042e0
# Parent  6f437923d70ead5e8bb7aa18177a8cb2968332cd
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):