Wandering around Mercurial Repositories
One of the things that makes mercurial useful and frustrating at the same time is that history is not linear. History can separate and join at multiple places. Tools such as hg log can’t show the outline of history clearly. There have been several attempts to remedy this situation: hg glog prints a revision graph using ASCII art, and hg view allows browing a repository history in a GUI app written in TK.
I think we can do better, so I started a new project: it is an extension to hgweb which allows browsing repository history graphically in a web browser. You can navigate graphically through revisions, and it will load new revisions on demand. Note that I’ve only tested it with Firefox, and it won’t work in IE (no SVG support):
mozilla-central on office.smedbergs.us.
There is certainly lots more that can and should be done:
- The layout algorithm is really dumb
- Revisions should link back to hgweb for viewing diffs, etc
- Would be nice to zoom out to get a larger picture with less detail
Unfortunately I don’t have any more time to spend on this project. So I’m looking for volunteers to come forward and finish it.
Installation Instructions
The code is here. It is packaged as a single mercurial extension which must be installed in a global hgrc file, and a www/ directory with static files. I believe this extension will work correctly against Mercurial 1.0: I’ve been testing it against a mercurial-crew pull from a couple days ago.
- In www/navigate.js configure BASEURL for your site
- In www/index.xhtml populate select-repo with the repositories on your site.
The hgweb extension exists primarily to provide repository information in JSON format. I hope that it will be useful for other kinds of projects as well.
April 10th, 2008 at 8:32 pm
Hey, this is really neat. I would volunteer to work on it, but I’m guessing you already have a big list of stuff you want from me. :-)
So, Graphviz (http://www.graphviz.org/) is pretty good for layout. Unfortunately, it’s not customizable, so I don’t think it would be too good at making parts of the SVG be links. But I think you could write that stuff on the side and postprocess the SVG. But it shouldn’t be too bad.
April 14th, 2008 at 5:09 pm
[…] RegisterLogin « Wandering around Mercurial Repositories […]