[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial-devel
Subject:    [PATCH 2 of 4] localrepo: set heads and branchheads to be
From:       John Mulligan <phlogistonjohn () asynchrono ! us>
Date:       2009-05-31 18:11:25
Message-ID: 6c4a55b1763ddb99dc43.1243793485 () karnak ! localdomain
[Download RAW message or body]

# HG changeset patch
# User John Mulligan <phlogistonjohn@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()
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic