comparison mercurial/commands.py @ 20791:8dd867bd67e1

backout: improve confusing 'cannot backout change on a different branch' abort These days 'branch' usually refer to a named branch. Instead, abort with 'cannot backout change that not is an ancestor'.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 24 Feb 2014 22:42:14 +0100
parents 49f2d5644f04
children 8c210b169c69
comparison
equal deleted inserted replaced
20790:49f2d5644f04 20791:8dd867bd67e1
437 node = scmutil.revsingle(repo, rev).node() 437 node = scmutil.revsingle(repo, rev).node()
438 438
439 op1, op2 = repo.dirstate.parents() 439 op1, op2 = repo.dirstate.parents()
440 a = repo.changelog.ancestor(op1, node) 440 a = repo.changelog.ancestor(op1, node)
441 if a != node: 441 if a != node:
442 raise util.Abort(_('cannot backout change on a different branch')) 442 raise util.Abort(_('cannot backout change that is not an ancestor'))
443 443
444 p1, p2 = repo.changelog.parents(node) 444 p1, p2 = repo.changelog.parents(node)
445 if p1 == nullid: 445 if p1 == nullid:
446 raise util.Abort(_('cannot backout a change with no parents')) 446 raise util.Abort(_('cannot backout a change with no parents'))
447 if p2 != nullid: 447 if p2 != nullid: