Transplanting merge results cleanly?

Martin Geisler mg at daimi.au.dk
Mon Jul 28 14:47:15 CDT 2008


"Matthew Moore" <mmoaot at gmail.com> writes:

> Forgive me if this is a frequently asked, obvious, or otherwise
> misguided question.
>
> Here is my use case - I want to, in my "work" repo, maintain a
> branch for development tasks. Then, when that task is complete, I
> need to merge with mainline. So I pull into my local repo from
> central, and merge mainline with my branch changes. I commit that
> merge, giving me a changeset on mainline with two parents that
> amounts to a diff containing all my branch work.
>
> Here's where I get confused.
>
> What I would like to do is push JUST the changeset that was the
> result of the merge up to the central repo, and NOT all my
> interstitial branch work. However when I "push -r" (or "pull -r"
> from the central repo) with the revision of the merge changeset, all
> my branch changesets follow (reasonably so, I'm presuming Mercurial
> needs to reconstruct the parent chain). But I want to keep the
> central repo "clean" of these details.

Okay, then you need to follow the proceduce described here:

  http://www.selenic.com/mercurial/wiki/index.cgi/ConcatenatingChangesets

> So it sounded like "transplant" is what I want (to "transplant" that
> merge changeset, applied only to mainline, with a single parent).
> But transplant appears to pull in all the branch changesets as well.

I have not used it myself, but as I have understood it, the transplant
extension makes it easy for you to take a changeset (essentially the
patch it represents) and apply it out of context. In other words,
similar to what

  hg -R ../some/other/repo export 123 | hg import -

would do, except that the transplant extension does some more
bookkeeping for you.

In your case it is not only the merge changeset that you need, but the
entire history behind the merge changeset, and the wiki page above
describes how to do that.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.


More information about the Mercurial mailing list