开发者

Converting from Mercurial to Subversion

Due to lack of Mercurial support in several tools, 开发者_如何学运维and managerial oppression it has become necessary to convert several trial Mercurial repositories to Subversion in order to conform with the company standard.

Are there any tools or suggestions for how to achieve this without a loss of revision history and the like?


The convert extension that ships with mercurial can use mercurial as a src and subversion as a dest.

hg convert --dest-type svn hgreponame svnreponame

Make sure to enable it in your .hgrc file.

If you want to keep using mercurial on the sly, then hgsubversion will allow you to do bidirectional sync.


Ry4an's answer above does the trick exactly; some more detailed instructions for anyone (like me) who's having trouble:

  1. Do yourself a favor and don't try this on Windows. You'll have to install a very specific version of SVN, and even then certain things will fail with assorted error messages. My solution was to boot a clean AWS instance, yum-get the latest versions of mercurial and svn onto it, clone the HG repo, and run the convert there.

  2. Add this to your .hgrc file to enable the convert extension:

    [extensions]
    hgext.convert=
    
  3. Run this command:

    hg convert --dest-type svn <hg_directory> <directory_for_svn_output>
    
  4. You might get the following error:

    abort: svn exited with status 256
    

    Don't give up! Just run the same command again and it'll continue where it left off.

    If you continue to run into trouble, add --debug --traceback to the command line to get more details on what went wrong.


Tailor should be able to do what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜