changeset 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 89059c450c56
files mercurial/commands.py tests/test-backout.t
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Mar 19 02:45:14 2014 +0100
+++ b/mercurial/commands.py	Mon Feb 24 22:42:14 2014 +0100
@@ -439,7 +439,7 @@
     op1, op2 = repo.dirstate.parents()
     a = repo.changelog.ancestor(op1, node)
     if a != node:
-        raise util.Abort(_('cannot backout change on a different branch'))
+        raise util.Abort(_('cannot backout change that is not an ancestor'))
 
     p1, p2 = repo.changelog.parents(node)
     if p1 == nullid:
--- a/tests/test-backout.t	Wed Mar 19 02:45:14 2014 +0100
+++ b/tests/test-backout.t	Mon Feb 24 22:42:14 2014 +0100
@@ -92,7 +92,7 @@
 should fail
 
   $ hg backout 1
-  abort: cannot backout change on a different branch
+  abort: cannot backout change that is not an ancestor
   [255]
   $ echo c > c
   $ hg ci -Am2
@@ -108,7 +108,7 @@
 should fail
 
   $ hg backout 1
-  abort: cannot backout change on a different branch
+  abort: cannot backout change that is not an ancestor
   [255]
   $ hg summary
   parent: 2:db815d6d32e6 tip