Merging two different repositories

You can just pull the changesets into one big repository. Start with the A repo:

$ hg init combined
$ cd combined
$ hg pull ../A
$ hg update

Then forcibly pull in B and dummy-merge the two heads so that you keep the files from B:

$ hg pull ../B --force
$ hg merge --tool internal:other
$ hg revert --all --rev tip
$ hg commit -m "Merge A and B, kept B"

Then repeat for C:

$ hg pull ../C --force
$ hg merge --tool internal:other
$ hg revert --all --rev tip
$ hg commit -m "Merge B and C, kept C"

That gives you three lines of history and a merge point where you first throw away A, then B, and finally end up with C.

Alternatively you can use the convert extension with a splice map to splice the three histories together. Start by forcibly pulling all the changesets into a single repository. Then do a Mercurial to Mercurial conversion where you add the tip of A as the first parent of the root of B. Similarly for B and C. That gives you one long history where there will be a very abrupt change when you go from A to B and from B to C.

I would go with the first option: it’s the most explicit and shows best what happens without faking (converting) the history.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)