[PATCH 06 of 12] localrepo: refactor repo.branchheads() to use repo.branchmap().branchheads()
Brodie Rao
brodie at sf.io
Fri Nov 15 20:27:38 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 9a6a65043164e404bf24d1b9b419f6cefe8b883a
# Parent 7b9b47384721d01206f4bed187374f48b03e742d
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