CVS to Mercurial

After some serious reading, pondering, apt-ing, and command-line hacking, I’ve decided to try mercurial. It was a three-way tie for which of the new-fangled open-source version control programs I was going to commit to really giving a try, between bzr, mercurial, and darcs. They all seem pretty darn similar, but a few things I read (that I can’t find now, of course) and the simple lack of dependencies (darcs required, like, 5 exim packages, what’s up with needing a mail server for revision control?), and more complete documentation than bzr lead me to go with mercurial. To start I decided to convert my simple .emacs cvs repository to mercurial. The instructions for converting repositories on the mercurial wiki are a little confusing, but here’s what I got to work on my Ubuntu Edgy Eft box:

aptitude install mercurial
aptitude install tailor

Then, in the directory where I wanted my mercurial repository (and make sure there isn’t a cvs checkout of the module you are converting there!):

mkdir hg-temp
cd hg-temp
tailor -v --source-kind cvs --target-kind hg --repository /home/bryan/cvsrepositories/dot-emacs --module dot-emacs -r INITIAL > dot-emacs.tailor
emacs dot-emacs.tailor

In the dot-emacs.tailor file, change subdir from . to MODULENAME (which is dot-emacs, in my case), and remove /MODULENAME from root-directory, like the wiki says. Then add the line:

patch-name-format =

at the end of the “project” section1. Then:

tailor --configfile dot-emacs.tailor

This creates three files, tailor.state.old, tailor.state, and project.log2 in the parent directory, as well as a directory called, dot-emacs. This new directory is your hg repository. Change to that directory and type hg log, and then hg log -v to see the preserved cvs history and checkin comments.

UPDATE: I used the search history feature of google and found the revision control comparison that swayed me towards mercurial over bazaar (or bzr). There was also this revision control comparison that slightly discouraged me from using darcs (though the exim requirement was much more discouraging) as it claimed it has some “deep bugs” still. Overall darcs looked quite impressive to me and maybe a little easier to use than the others, just to clarify.

Footnotes

1At least, that’s what I liked best, 'man tailor’ and search for 'patch-name-format’ for more info on this.

2As far as I know you can blow these files away when you’re done.

Posted by Bryan on December 12, 2006

Comments

Post a comment


Topics

Highlights

Other Stuff

rss feed for latest comments Latest comments feed

What are these orange icons?

Search This Site

Archives


This site assembled by Bryan Murdock, using: