Well, I finally did it: I converted my personal Subversion repository to Mercurial. Looking at svn log, I created the original repository back in late 2002, and since I was tracking svn trunk at the time, I would have been on some intermediary version of the 0.14.4 alpha. Ye ghods, that seems like a long time ago. I still remember how happy I was that svn had stabilized to the point where I was comfortable switching from CVS (at the time, I just dumped my old CVS repository history and imported everything as it sat on disk). I can't count the number of times I've had to do an svnadmin dump/svnadmin load cycle on that repository since creating it, either because of format changes, bugs, or because I did something stupid; it always felt a little like PostgreSQL upgrades in that respect. ;) It's served me very well for eight years (well, longer than that, but prior use was mostly as a toy), but the lure of distributed repositories and easy merges beckoned.
So, it's done. Turns out that hg convert works pretty damn well; it appears to have retained all history without any problems, and dropping a clone of the hg repo in place of my existing checkouts was basically a non-event. Trac bolted up to the converted repository without a hitch with the Mercurial repository module, and hgwebdir means I finally have a consolidated web and native interface to the repository again (when I moved to lighttpd, I lost mod_dav_svn, and ended up resorting to svnserve to provide a public read-only interface). Overall, conversion was a snap.
If anyone is curious about the configuration details, I'm running hgwebdir under lighttpd with FastCGI. The lighttpd configuration looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | fastcgi.server += ( "/hg" => ( "hg" => ( "socket" => "/path/to/hgwebdir.sock", "bin-path" => "/path/to/hgwebdir.fcgi", "check-local" => "disable", "disable-time" => 1, "min-procs" => 1, "max-procs" => 1, ), ), ) $HTTP["request-method"] !~ "^(GET|HEAD)" { auth.require = ( "/hg" => ( "method" => "digest", "realm" => "admin", "require" => "valid-user" ), ) } |
hgwebdir.fcgi is just a modified version (paths changed) of the script that ships with Mercurial. From the above, I'm just serving all things Mercurial up as /hg/, and requiring authentication for anything other that GET or HEAD requests, so visitors can browse it read-only, but authenticated users can push changes. hgweb.config just contains:
1 2 3 4 5 6 | [web] baseurl = /hg allow_push = * [collections] /path/to/hg/repo/parent = /path/to/hg/repo/parent |
That's it. (But, unless you're familiar with every layer sitting on top of your repository, I'd probably suggest changing allow_push to something more restrictive.)