RFC: adding a 'qsplit' command to interactively split an mq patch

Patrick Mézard pmezard at gmail.com
Mon Apr 11 08:04:37 CDT 2011


Le 11/04/11 14:48, Augie Fackler a écrit :
> On Apr 11, 2011, at 4:37 AM, Idan K wrote:
>>
>> Hi,
>>
>> I'm thinking of adding a 'qsplit' command to mq that lets the user
>> accept/reject hunks from the current patch (or a specified one) to be moved
>> to a new one. Selection will be done like shelve/record.
>> This is mostly useful for splitting by content since splitting by files can
>> be done with 'qrefresh' (see [1]).
>>
>> Usage might look like this: hg qsplit [existing-patch-to-split]
>> <new-patch-name>
>>
>> Example:
>>
>> $ hg qtop
>> patch-to-split
>>
>> $ hg qsplit new-splitted
>> [interactively accept/reject hunks from 'patch-to-split' that will move to
>> 'new-splitted']
>>
>> $ hg qseries
>> patch-to-split
>> new-splitted
>>
>> $ hg qtop
>> new-splitted
>>
>> AFAIK it's possible to do this manually as described in [1], but I've had to
>> do this on several occasions to want a more friendly alternative.
>>
>> How does this sound to other mq users?

hg qrefresh --interactive should be considered too.

But it is harder to implement because of the regular/--short modes.
 
> I think I'd be more interested in an 'hg qpop --no-changes' which would pop a patch without updating the files in the working copy, since if we had that you could just use qrecord for patch splitting needs and other types of trickery.
> 
> Both is probably even better, but mq is already a nightmare of extra commands as it is...

I'd rather have qdelete do that to the topmost applied patch (instead of qrefresh -I dummy; hg qpop --force; hg qdel `hg qnext`)

--
Patrick Mézard


More information about the Mercurial-devel mailing list