Patchwork [1,of,9] backout: improve confusing 'cannot backout change on a different branch' abort

login
register
mail settings
Submitter Mads Kiilerich
Date March 18, 2014, 11:33 p.m.
Message ID <ffaeeb8d43872aca4c32.1395185629@localhost.localdomain>
Download mbox | patch
Permalink /patch/3972/
State Accepted
Commit 8dd867bd67e19d44a945d785b9092a9dbedb7849
Headers show

Comments

Mads Kiilerich - March 18, 2014, 11:33 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1393278134 -3600
#      Mon Feb 24 22:42:14 2014 +0100
# Node ID ffaeeb8d43872aca4c329937b793c6b4919ce192
# Parent  77318d3c3b242cf047a3e73dd663159dac249fb8
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'.
Matt Mackall - March 19, 2014, 6:19 p.m.
On Wed, 2014-03-19 at 00:33 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1393278134 -3600
> #      Mon Feb 24 22:42:14 2014 +0100
> # Node ID ffaeeb8d43872aca4c329937b793c6b4919ce192
> # Parent  77318d3c3b242cf047a3e73dd663159dac249fb8
> backout: improve confusing 'cannot backout change on a different branch' abort

Queued for default, thanks.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -439,7 +439,7 @@  def backout(ui, repo, node=None, rev=Non
     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:
diff --git a/tests/test-backout.t b/tests/test-backout.t
--- a/tests/test-backout.t
+++ b/tests/test-backout.t
@@ -92,7 +92,7 @@  across branch
 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
 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