MQ: break up a 'qrefresh'

John W jwdevel at gmail.com
Tue Apr 14 17:06:11 UTC 2015


Yes, that is not terrible in the 80% case.

I'm trying to avoid manual interactivity if possible, and ideally
doing something that works for a totally general case.

I'm pretty sure this *is* possible to solve generally — all the
information is there. It's just cumbersome, every way I can think
of...

-John

On 4/14/15, Harvey Chapman <hchapman-hg at 3gfp.com> wrote:
>
>> On Apr 14, 2015, at 12:32 PM, Harvey Chapman <hchapman-hg at 3gfp.com>
>> wrote:
>>
>>
>>> On Apr 14, 2015, at 12:10 PM, John W <jwdevel at gmail.com> wrote:
>>>
>>> I know how to do what I want, but before I write an extension for it,
>>> I figured I'd ask if there's some better and/or built-in way to do it.
>>>
>>> It's a pretty simple situation:
>>>
>>> 1. You have a patch applied (call it P1), and it modifies the file
>>> 'foo'.
>>> 2. You make some updates to 'foo' and run 'qrefresh'. Now P1 is
>>> modified (call it P1*).
>>> 3. You decide that actually, those changes should be a separate patch
>>> (P2).
>>>
>>> How best to extract those changes to P1 into a new patch, P2?
>>>
>>> In other words: You have P1*, and you want P1, P2
>>>
>>> If the MQ patches have their own repo, this is doable with some
>>> moderate shenanigans - you need to create one head with P1 and another
>>> with P1*, do a diff between them, save that diff as P2, etc.
>>>
>>> Is there a more straightforward way to accomplish this in Mercurial?
>>> it seems like a fairly common occurrence, so I imagined there might be.
>>
>> "hg qrefresh —interactive” will probably work unless your changes are
>> close together.
>
> I had to remove the file from the patch first:
>
>     hg qrefresh -X file
>     hg qrefresh -s -i file



More information about the Mercurial mailing list