[PATCH 0 of 1] Add qpush --exact

Steve Losh steve at stevelosh.com
Mon Nov 22 11:33:07 CST 2010


On 11/18/10 at 01:51P, Matt Mackall wrote:
> On Wed, 2010-11-17 at 21:18 -0500, Steve Losh wrote:
> > We've been writing '# Parent abc123...' headers into MQ patches (as long as
> > mq.plain isn't set) for two full versions now, but we haven't done anything
> > special/useful with them yet.
> > 
> > A common problem I encounter is this:
> > 
> > 1. Someone sends me some MQ patches, or I make some.
> > 2. I want to rebase them to the tip of a repo.
> > 3. I run 'head' on the first patch file to see where I'm supposed to apply it.
> > 4. I apply it, then rebase as normal to use the merge machinery to update the
> >    patches.
> > 
> > I want to eliminate step 3.
> 
> Not sure if this is how I want to proceed. I've been thinking of 
> moving in this direction:
> 
> You qpush or import a patch with a --try-magical-merge flag
> The patch code finds the parent revision P in the patch
> If that revision is present:
>   remember current revision as T
>   update to patch parent
>   apply patch
>   update T --force-ancestor P
>   commit patch
> 
> With the force-ancestor switch, we force P to be chosen as the merge
> ancestor, which means we combine all the changes P->T with all the
> changes P->patch.
> 
> In other words, we get the mechanics of rebasing without having to strip
> commits.
> 
> This also makes it possible to greatly simplify the rebase code and make
> transplant-style operations easier.

Yeah, I remember talking about this kind of thing at the previous sprint.

It's a good idea, but I think there's still a place for a --exact command to
tell qpush "I just want to put these patches where they belong".

The --merge-smartly option would take care of my case, but what if I just want
to put the patches where I *know* they'll apply?  Example:

1. I report a bug that only happens on OS X.
2. You come up with a patch that should fix the bug.
3. You send me the patch so I can test it, because you might not have an OS
   X system around.
4. I just want to test your patch, so I use --exact.

I don't want to worry about resolving any conflicts that may happen even with
--merge-smartly.  You wrote the patch, so you're the one that would be better
at resolving conflicts. I just want to see if your patch fixed my bug.

In short, I'm all for a --merge-smartly option in qpush, but I don't think it
completely removes the usefulness of --exact.

> 
> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 

-- 
Steve Losh


More information about the Mercurial-devel mailing list