31 January 2008 2:51 pm (mercurial | python | version control)
Over the last two and a half years we (at work) have been using baz as our distributed version control system. Baz is based on tla, the original GNU arch implementation by Tom Lord. After all this time we have applied more than two thousand patches (distributed in various projects). We also have been using Xtla (a wonderful Emacs front-end to GNU Arch) and lately DVC (its successor, which handles GNU Arch, Bazaar, git, Mercurial and Monotone). After some months thinking about it, I decided that it was time for a change, baz was too slow working with this magnitude of patches and even slower in my PowerBook. I also wanted a fast web interface and ArchZoom was not an option as it took ages to show changes between two revisions and mostly in any operation. So, I watched the Mercurial Google TechTalk and I also read some blog entries about git and Bazaar. I decided to give Mercurial a try as it also had complete DVC support and a great web interface (like the darcs one).
One of the things I needed was a tool to convert our baz repositories to Mercurial. As far as I knew, there was no such a tool, so I thought I could use arch2darcs to convert the repositories to darcs and then use the Mercurial convert extension to convert them to Mercurial. I tried it but it didn't work. The Mercurial convert extension worked really well with darcs for my personal projects, so, why not write a GNU Arch converter?
After some days trying it, I have posted an issue to Mercurial BTS with a GNU Arch converter. It currently does not support directory renaming (fixed, see updates), but all other things I have tried work well. The converter is slow as I didn't know how to compute a complete changeset between patches easily (any help?... solved, see updates). The log files might not provide all the information needed (added, removed, modified files), so I decided to use the delta command which computes all this information, and this takes a bit of time.
To use the converter (in 0.9.5) copy it to the convert extension directory (hgext/convert) and edit the __init__.py file following, for example, the darcs converter (you'll easily see how to add it). Use the converter at your own risk, as I am sure it needs more work. I would appreciate any comments and bug reports until it is included in Mercurial (if ever).
Update 2008/04/28: The GNU Arch converter is available since Mercurial 1.0.
Update 2008/02/09: The converter does not use the delta command anymore to compute a changeset (the replay command used to merge already does it). This has increased speed drastically (in the order of hours).
Update 2008/02/06: The GNU Arch converter has been added to Mercurial development branch. Thanks!
Update 2008/02/04: Directory renaming is now supported. A bug related to link modifications has been fixed. The '--rev' option is also supported. You will need to download and install the development branch (hg clone http://hg.intevation.org/mercurial/crew) and apply the patch provided here.
Update 2008/02/01: Yesterday, I found this page (weird, as I didn't see it some days ago) which talks about GNU Arch conversions to Mercurial. None of the converters uses the convert extension, but I guess it would had been easier to reuse them.