Patchwork [2,of,2,v2] rebase: improve error message for more than one external parent

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 24, 2013, 4:12 a.m.
Message ID <e706cb1e4bd64d4f81ca.1382587949@localhost.localdomain>
Download mbox | patch
Permalink /patch/2813/
State Accepted
Commit 78ab0f85e249ef040e6933f8641dabbaee27c05a
Headers show

Comments

Mads Kiilerich - Oct. 24, 2013, 4:12 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1382542933 -28800
#      Wed Oct 23 23:42:13 2013 +0800
# Branch stable
# Node ID e706cb1e4bd64d4f81ca825b961f414041b9b418
# Parent  6e6a1ee0ab34df6dae577832dc229054d42c58ed
rebase: improve error message for more than one external parent
Matt Mackall - Oct. 25, 2013, 8:19 p.m.
On Thu, 2013-10-24 at 12:12 +0800, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1382542933 -28800
> #      Wed Oct 23 23:42:13 2013 +0800
> # Branch stable
> # Node ID e706cb1e4bd64d4f81ca825b961f414041b9b418
> # Parent  6e6a1ee0ab34df6dae577832dc229054d42c58ed
> rebase: improve error message for more than one external parent

These are queued for stable, thanks.

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -406,8 +406,10 @@  def externalparent(repo, state, targetan
         return nullrev
     if len(parents) == 1:
         return parents.pop()
-    raise util.Abort(_('unable to collapse, there is more '
-                       'than one external parent'))
+    raise util.Abort(_('unable to collapse on top of %s, there is more '
+                       'than one external parent: %s') %
+                     (max(targetancestors),
+                      ', '.join(str(p) for p in sorted(parents))))
 
 def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None):
     'Commit the changes and store useful information in extra'
diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t
--- a/tests/test-rebase-collapse.t
+++ b/tests/test-rebase-collapse.t
@@ -226,7 +226,7 @@  Rebase and collapse - more than one exte
   $ cd b1
 
   $ hg rebase -s 2 --collapse
-  abort: unable to collapse, there is more than one external parent
+  abort: unable to collapse on top of 7, there is more than one external parent: 1, 5
   [255]
 
 Rebase and collapse - E onto H: