Reverse of qpush --move?
Matt Mackall
mpm at selenic.com
Thu Jul 8 09:44:53 CDT 2010
On Thu, 2010-07-08 at 15:56 +0200, Jason Harris wrote:
> 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...
Ok, question #1: what does the command look like? ie, if I type:
qpop --move patchB
does that:
a) pop patchB from wherever it is in the stack and make it the next
thing that would get pushed
or
b) pop the current top-most patch from the stack and put it before
patchB
or
c) pop the current top-most patch from the stack and put it after patchB
Option (a) opens a large can of worms and option (b) and (c) are going
to be confused for each other approximately 50% of the time, which
sucks. And I don't think any of them is precisely what's wanted here
anyway.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list