Transplanting mercurial changeset onto hgsubversion converted repository
I have been migrating from subversion to mercurial piecemeal and this has created a bit of a tangle. I had an old SVN server (pre 1.4) to start with so here is what happened.
- HgSubversion did not want to pull in the full history from trunk, so I did a shallow convert.
- My colleagues did their last commits to SVN and I pulled those into Hg.
- We moved over to Hg and started pushing to it
- Just to be safe one of my colleagues made some more commits to SVN.
- I managed upgrade the SVN server and get the full repo to the new SVN.
- HgSubversion pulled in the full history successfully - including the few extra/duplicate commits.
Now I would like to "transplant" the commits in the shallow mercurial repository into the full history, the repositories are related in c开发者_如何学编程ontent but unrelated in mercurial hashes.Short of just copy pasting content what would be the best way to migrate the changes ? Eventually everybody should be able:
- To switch the Hg repo with full history and keep working
- Have automated push from the Hg repos of suitable squashed/rebased changesets to SVN as a service user.
I would like a concrete example with the following scenario.
- Last mercurial hash at step 2 - A
- Current mercurial hash after pushes step 3 - B
- Hash of last commit after pull from upgraded SVN - C
- Hash of step 2 commit after full SVN history pull - D
I am not very good at ASCII art, feel free to add one for bonus points.
We did a CVS -> Mercurial migration last week at work. Like in your case, some people continued to use the CVS for a time.
In order to sync the the two repositories when the CVS server was finally shutdown, I did the following :
- Convert the CVS to mercurial via cvs2hg
- Export each new revision with hg export
- Import the patch files with hg patch
There was only a dozen revisions, so this was no big deal... If you have many more revisions, you could maybe take a look at the transplant extension.
Hope this helps.
精彩评论