[PATCH 3 of 8 ancestor-ish] backout: don't limit heritage check to a single ancestor
Mads Kiilerich
mads at kiilerich.com
Mon Apr 7 16:18:19 CDT 2014
# HG changeset patch
# User Mads Kiilerich <madski at 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.
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)
More information about the Mercurial-devel
mailing list