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

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 30, 2014, 7:08 p.m.
Message ID <2a038deeac9a884964c7.1417374508@localhost.localdomain>
Download mbox | patch
Permalink /patch/6906/
State Accepted
Commit 2a038deeac9a884964c7485f599734ea52415edc
Headers show

Comments

Mads Kiilerich - Nov. 30, 2014, 7:08 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@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.

Patch

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: