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

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 23, 2013, 5:54 p.m.
Message ID <9c9093febeb627dca63b.1382550846@localhost.localdomain>
Download mbox | patch
Permalink /patch/2806/
State Superseded
Commit 78ab0f85e249ef040e6933f8641dabbaee27c05a
Headers show

Comments

Mads Kiilerich - Oct. 23, 2013, 5:54 p.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 9c9093febeb627dca63bc30c7ecf515feaea5c24
# Parent  b7f76db06dc0f1c85f05256eaba7ac7559e811e9
rebase: improve error message for more than one external parent
Pierre-Yves David - Oct. 23, 2013, 7:04 p.m.
On 23 oct. 2013, at 19:54, 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 9c9093febeb627dca63bc30c7ecf515feaea5c24
> # Parent  b7f76db06dc0f1c85f05256eaba7ac7559e811e9
> rebase: improve error message for more than one external parent

This is hardly an improvement. I agree that the initial message is a bit cryptic, but your new version is just wrong.

>   $ hg rebase -s 2 --collapse
> -  abort: unable to collapse, there is more than one external parent
> +  abort: unable to collapse, there is more than one external parent to 1

We start from:

@  7: 'H' 
|
| o    6: 'G' 
| |\
| | o  5: 'F' 
| | | 
| | o  4: 'E' 
| | | 
| o |  3: 'D' 
| |\| 
| o |  2: 'C' 
|/ /
| o  1: 'B' 
|/
o  0: 'A' 

And we try to rebase+collapse 2:: (2,3,6) on 7. And we can't because the result would have three parents (7, 1 and 5)

The new message: abort: unable to collapse, there is more than one external parent to 1
- Wrongly present 1 as part of the rebased set,
- Does not list the actual issue (more than 2 parents to the result 7, 1 and 5)

(note: the example would be better if 5 was not a descendants of 1. I believe we could have rebase working in this situation.)
Matt Mackall - Oct. 23, 2013, 10:53 p.m.
On Wed, 2013-10-23 at 21:04 +0200, Pierre-Yves David wrote:
> We start from:
> 
> @  7: 'H' 
> |
> | o    6: 'G' 
> | |\
> | | o  5: 'F' 
> | | | 
> | | o  4: 'E' 
> | | | 
> | o |  3: 'D' 
> | |\| 
> | o |  2: 'C' 
> |/ /
> | o  1: 'B' 
> |/
> o  0: 'A' 
> 
> And we try to rebase+collapse 2:: (2,3,6) on 7. And we can't because the result would have three parents (7, 1 and 5)
> 
> The new message: abort: unable to collapse, there is more than one external parent to 1
> - Wrongly present 1 as part of the rebased set,

That much seems clear, dropping this for now.
Mads Kiilerich - Oct. 24, 2013, 4:14 a.m.
On 10/24/2013 03:04 AM, Pierre-Yves David wrote:
> On 23 oct. 2013, at 19:54, 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 9c9093febeb627dca63bc30c7ecf515feaea5c24
>> # Parent  b7f76db06dc0f1c85f05256eaba7ac7559e811e9
>> rebase: improve error message for more than one external parent
> This is hardly an improvement. I agree that the initial message is a bit cryptic, but your new version is just wrong.

Right. Resent.

/Mads

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -403,7 +403,7 @@  def checkexternal(repo, state, targetanc
                         and p.rev() not in targetancestors):
                 if external != nullrev:
                     raise util.Abort(_('unable to collapse, there is more '
-                            'than one external parent'))
+                            'than one external parent to %s') % external)
                 external = p.rev()
     return external
 
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, there is more than one external parent to 1
   [255]
 
 Rebase and collapse - E onto H: