Search code examples
mercurialhgsubversion

Mercurial How To Merge 2 Repositories that share a common ancestor but are not clones of the same repo


I am using hg-subversion, and I have 2 different hg repositories one from our svn trunk, and one from a branch of the trunk. I would like to link them somehow. At some point in the history both Hg repositories will be identical is there some way to join them?

In other words is there a way to relate the repositories from within Hg?

The technique I am currently using is to just export the second repository over top of the working copy of the revision they share, and then commit that working copy as a branch in Hg, but I lose the history this way.

Any advice would be great


Solution

  • You could try importing the two repos into one as if unrelated, then merging them. (When you say they share a common ancestor, do you mean that those ancestors have the same revision ID? If so there is a good chance that this will work well.)

    hg clone repoA
    hg pull -f repoB # may not need -f
    hg merge