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

John Mulligan phlogistonjohn at asynchrono.us
Tue Jun 2 18:14:43 CDT 2009


# HG changeset patch
# User John Mulligan <phlogistonjohn at asynchrono.us>
# Date 1243802913 14400
# Node ID 23c1aedca1eed577de2069a1497127a1ae4f5fbc
# Parent  45f626a39def2b1b8f7302453df35e4e929bfaae
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