Reverse of qpush --move?

Jason Harris jason at jasonfharris.com
Thu Jul 8 13:56:49 UTC 2010


On Jul 8, 2010, at 3:48 PM, Matt Mackall wrote:

> On Thu, 2010-07-08 at 15:04 +0200, Jason Harris wrote:
>> On Jul 8, 2010, at 2:56 PM, Matt Mackall wrote:
>> 
>>> On Thu, 2010-07-08 at 09:54 +0100, Colin Caughie wrote:
>>>> I see Mercurial 1.6 introduces the --move option to the qpush command,
>>>> to allow you to move a patch to the start of the queue while pushing
>>>> so that only that one gets applied.
>>>> 
>>>> This sounds useful, but I've just encountered a situation where I want
>>>> to do the reverse. I have a patch queue like this:
>>>> 
>>>> (applied)
>>>> patchA
>>>> patchB
>>>> patchC
>>>> ------
>>>> (not applied)
>>>> patchD
>>>> 
>>>> and I'd like to do something like "qpop --move patchB" to end up with
>>>> 
>>>> (applied)
>>>> patchA
>>>> patchC
>>>> ------
>>>> (not applied)
>>>> patchB
>>>> patchD
>>> 
>>> qpop patchA
>>> qpush --move patchC
>>> 
>>>> Is something like this possible?
>>> 
>>> Note that qpop and qpush --move are functionally complete: any ordering
>>> can be achieved by combining the two. For instance, Simply pop
>>> everything and qpush --move each patch into the proper order.
>> 
>> If you have 
> 
> I didn't say it was easy, I said it was functionally complete.
> 
>> This should be done in code by Mercurial
> 
> Great, send a patch. As I've already gone to pains to point out, this
> problem is not symmetrical. qpush --move is (nearly) trivial, but qpop
> --move is much much harder (and still won't be sufficient to make
> everyone happy).

But it can be done programmatically just as you suggested. I wasn't saying the implementation was bad. I was saying forcing the user to issue a whole bunch of steps is bad :) Internally Mercurial could do exactly as you are suggesting...

Who coded the qpush --move? (I really like this BTW so qudos to whoever did it...) Anyway likely this should be fairly easy for them to add?

> The only sensible way to do non-trivial reordering of things is in a
> visual tool like a GUI or text editor. As you're in the business of
> making the former,

Hence my interest :)

Cheers,
  Jas


More information about the Mercurial mailing list