Patchwork [3,of,8,ancestor-ish] backout: don't limit heritage check to a single ancestor

login
register
mail settings
Submitter Mads Kiilerich
Date April 7, 2014, 9:18 p.m.
Message ID <c13578458af167096db8.1396905499@mk-desktop>
Download mbox | patch
Permalink /patch/4258/
State Accepted
Commit 6ae0c41e4b525d9b331db2c089cce660de01da61
Headers show

Comments

Mads Kiilerich - April 7, 2014, 9:18 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1396905471 -7200
#      Mon Apr 07 23:17:51 2014 +0200
# Node ID c13578458af167096db83403c84d17fcac05202c
# Parent  daf78790ee72a16eadebbe64fc70cd00a8680a9d
backout: don't limit heritage check to a single ancestor

This do probably not make any real difference but is slightly more correct and
we would like to get rid of changelog.ancestor.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -438,8 +438,7 @@  def backout(ui, repo, node=None, rev=Non
     node = scmutil.revsingle(repo, rev).node()
 
     op1, op2 = repo.dirstate.parents()
-    a = repo.changelog.ancestor(op1, node)
-    if a != node:
+    if node not in repo.changelog.commonancestors(op1, node):
         raise util.Abort(_('cannot backout change that is not an ancestor'))
 
     p1, p2 = repo.changelog.parents(node)