[PATCH 0 of 1] Add qpush --exact

Matt Mackall mpm at selenic.com
Thu Nov 18 13:51:58 CST 2010


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.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list