[PATCH 01 of 17] merge: 0 is a valid ancestor different from None

Mads Kiilerich mads at kiilerich.com
Sun Nov 30 19:08:28 UTC 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1417372013 -3600
#      Sun Nov 30 19:26:53 2014 +0100
# Node ID 2a038deeac9a884964c7485f599734ea52415edc
# Parent  b913c394386f0a6ebbdcb7e321ff82816d7799fe
merge: 0 is a valid ancestor different from None

Most internal functions can take either a hash or an integer. Merge did however
not handle 0 as revision 0. Now it does.

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -968,7 +968,7 @@ def update(repo, node, branchmerge, forc
         pl = wc.parents()
         p1 = pl[0]
         pas = [None]
-        if ancestor:
+        if ancestor is not None:
             pas = [repo[ancestor]]
 
         if node is None:


More information about the Mercurial-devel mailing list