changeset 19956:78ab0f85e249 stable

rebase: improve error message for more than one external parent
author Mads Kiilerich <madski@unity3d.com>
date Wed, 23 Oct 2013 23:42:13 +0800
parents 2160c2e0d7d1
children 80aa912dcb2d
files hgext/rebase.py tests/test-rebase-collapse.t
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Oct 24 12:05:22 2013 +0800
+++ b/hgext/rebase.py	Wed Oct 23 23:42:13 2013 +0800
@@ -406,8 +406,10 @@
         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'
--- a/tests/test-rebase-collapse.t	Thu Oct 24 12:05:22 2013 +0800
+++ b/tests/test-rebase-collapse.t	Wed Oct 23 23:42:13 2013 +0800
@@ -226,7 +226,7 @@
   $ 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: