Home

apparently I'm a dinosaur

Late to the distributed party

the dinosaur

floating

Late to the distributed party

Previous Entry Add to Memories Tell a Friend Next Entry
floating
Two blog posts in one day!

Distributed revision control systems are all the rage these days and I think the time has come to adopt one. I've always thought they were a good idea, but Subversion worked well and suited my needs well enough. I was also somewhat put off by the number of choices and didn't want to switch to something that would turn out to be a dud. But now there seem to be two main contenders, Git and Mecurial. I think Linus' recent talk on git also helped rekindle my interest.

Despite Linus' protestations of greatness, I was thinking of using Mercurial since it seems to fit better with my Subversion centric view of the world and it appears that Mozilla is going to move to it from CVS. I already have a few CVS and Subversion repositories for various things and I would like to keep that history. So I fired up Tailor and started converting a mail archive I have in an svn repo. The repo is only 1.5G, but Tailor was slow. Surprisingly slow. It then failed right near the end of the conversion. I'm also not sure exactly how much history Tailor is preserving. Does it deal with things like file moves properly?

Disheartened, I took a look at git instead. It seemed to have a tool called git-svnimport that sounded very promising. I ran it against the same svn repo and it proceeded to consume all the memory on my system and cause it to thrash like mad. My machine became so unresponsive that I had to log in remotely to kill the import.

So in the end, dear lazyweb, what tools should one use to convert a Subversion repository to Mercurial and/or Git?
  • (Anonymous)
    You could try with git-svn.
    • git and mercurial

      (Anonymous)
      you can sync a git repo from mercurial quite easily, and a mercurial mirror of the linus kernel branch is being kept permanently.
      If you want to use mercurial you can benefit from git-svn conversion tools and later convert the git repo to a mercurial one.
      I personally find mercurial much easier to work with than git, but both are excellent options.
      • Re: git and mercurial

        (Anonymous)
        Oh, and you could have a look to the mercurial book, that will get you nicely into distributed systems. http://hgbook.red-bean.com/
      • Re: git and mercurial

        What tool would you use to do this?
  • (Anonymous)
    tailor does not handle branching or merging; it handles a single linear history. Don't use it. Use tools specific to the source and target systems, to avoid losing valuable history.
  • We used git-svnimport to convert the XSF SVN repo to git. Since it was a really messy repo thanks to yours truly, we had to do some custom fixes on git-svnimport to make it work. Thierry Redding wrote a whole system to convert our repo in to a set of smaller git repos. You can find it on git.debian.org under the pkg-xorg directory.
  • bzr

    (Anonymous)
    You could use bzr as an intermediary. Bzr has plugins which treat svn (and other systems) as if they were native, allowing you to branch, share changesets with other bzr users branching from svn, and even committing to svn. Converting from bzr to either hg or git should be a lot easier.

    Of course, you could also try out bzr, and see if you like it better than hg or git, and thus avoid the second conversion. :-)
  • SVN to Mercurial conversion tools

    (Anonymous)
    There are several SVN->Mercurial conversion tools, as there are several ways you can do bad things in a SVN repository (multibranch-commits, non-default layouts, etc.)

    You can get a list from http://www.selenic.com/mercurial/wiki/index.cgi/RepositoryConversion and my suggestion is to try with yasvn2hg and, if the results aren't satifying, with the convert-repo shiiped in the contrib/ section of the Mercurial package.
  • Converting SVN to Hg

    (Anonymous)
    I actually went through the effort of converting SVN to Hg recently, and posted my notes online here: SVN to Hg (http://ww2.samhart.com/node/49)

    I actually had a very hard time getting most of the conversion tools to work until I tried out hgsvn which worked like a charm. I had similar issues with Tailor, which I found to be pretty broken.

    At my page above I posted pretty detailed instructions for converting using hgsvn and then setting up a reasonable SVN-ish Hg replacement (e.g., setting up Hg to serve over HTTP, etc).
Powered by LiveJournal.com