[PATCH 1 of 2] rebase: add --detach to force detaching from the original branch (issue1950)

Stefano Tortarolo stefano.tortarolo at gmail.com
Sat Jan 2 11:40:13 CST 2010


2009/12/31 Matt Mackall <mpm at selenic.com>:
> On Thu, 2009-12-31 at 02:50 +0100, Stefano Tortarolo wrote:
>> +                if collapsef:
>> +                    raise error.ParseError(
>> +                        'rebase', _('cannot use collapse with detach'))
>
> Why not?

Ehm.. there's no reason to avoid collapsing.
I'll remove that check.

>> +                if basef:
>> +                    raise error.ParseError(
>> +                        'rebase', _('cannot specify a base with detach'))
>> +
>>              cmdutil.bail_if_changed(repo)
>> -            result = buildstate(repo, destf, srcf, basef, collapsef)
>> +            result = buildstate(repo, destf, srcf, basef, collapsef, detachf)
>>              if result:
>> -                originalwd, target, state, external = result
>> +                originalwd, target, state, detach, external = result
>
> If some crazy person decides to update hg while in the middle of a
> rebase, what happens?

Obviously it would fail. The problem in that case happens in
restorestatus, though.
How would you manage this situation?

Thanks.

Stefano


More information about the Mercurial-devel mailing list