Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 20986:6ae0c41e4b52
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.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 07 Apr 2014 23:17:51 +0200 |
parents | d3775db748a0 |
children | 2db41f95c4a2 |
comparison
equal
deleted
inserted
replaced
20985:231ccc08670c | 20986:6ae0c41e4b52 |
---|---|
436 cmdutil.checkunfinished(repo) | 436 cmdutil.checkunfinished(repo) |
437 cmdutil.bailifchanged(repo) | 437 cmdutil.bailifchanged(repo) |
438 node = scmutil.revsingle(repo, rev).node() | 438 node = scmutil.revsingle(repo, rev).node() |
439 | 439 |
440 op1, op2 = repo.dirstate.parents() | 440 op1, op2 = repo.dirstate.parents() |
441 a = repo.changelog.ancestor(op1, node) | 441 if node not in repo.changelog.commonancestors(op1, node): |
442 if a != node: | |
443 raise util.Abort(_('cannot backout change that is not an ancestor')) | 442 raise util.Abort(_('cannot backout change that is not an ancestor')) |
444 | 443 |
445 p1, p2 = repo.changelog.parents(node) | 444 p1, p2 = repo.changelog.parents(node) |
446 if p1 == nullid: | 445 if p1 == nullid: |
447 raise util.Abort(_('cannot backout a change with no parents')) | 446 raise util.Abort(_('cannot backout a change with no parents')) |