[PATCH 2 of 4] localrepo: set heads and branchheads to be closed=False by default

John Mulligan phlogistonjohn at asynchrono.us
Sun May 31 13:11:25 CDT 2009


# HG changeset patch
# User John Mulligan <phlogistonjohn at asynchrono.us>
# Date 1243790363 14400
# Node ID 6c4a55b1763ddb99dc43bf617023630f4ff00fb9
# Parent  25fa695f61c983e5880637667b09f801f3383e2f
localrepo: set heads and branchheads to be closed=False by default

without explicitly setting the closed argument the heads(...) and
branchheads(...) functions will not return closed heads

this will cause 'hg merge' to have better behavior in the presence of
a branch that has closed heads when an explicit rev is not given

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1114,7 +1114,7 @@
             finally:
                 wlock.release()
 
-    def heads(self, start=None, closed=True):
+    def heads(self, start=None, closed=False):
         heads = self.changelog.heads(start)
         def display(head):
             if closed:
@@ -1125,7 +1125,7 @@
         heads = [(-self.changelog.rev(h), h) for h in heads if display(h)]
         return [n for (r, n) in sorted(heads)]
 
-    def branchheads(self, branch=None, start=None, closed=True):
+    def branchheads(self, branch=None, start=None, closed=False):
         if branch is None:
             branch = self[None].branch()
         branches = self.branchmap()


More information about the Mercurial-devel mailing list