[PATCH 0 of 3] Alternative graph web interface to better handle named branches

Francesco Degrassi francesco.degrassi at emaze.net
Mon Aug 16 18:22:13 CDT 2010


serve/graph: Alternative graph web interface to better handle named branches

The current implementation of the "graph" webcommand in the "hg serve" web interface works, but is not very easy and expressive; in particular, repos with many named branches are not really easy to visualize.
These changesets add a new webcommand to the web interface, plot, which is a revised implementation of what "graph" currently does.

Example:
 with graph (currently in mercurial): http://img838.imageshack.us/img838/9715/graph.gif
 with plot (my proposed alternative): http://img838.imageshack.us/img838/6246/plots.gif

The main features are:
 * each named branch is assigned a separate plot column and color
 * columns and colors are reused when a branch is closed or marked inactive
 * anonymous branches are plotted as part of the relative named branch
 * named branches are plotted to the right of their parent branch
 * a set of "pivot" named branches can be configured, these will always be plotted and other branches will be positioned relative to these; this is useful for branches like "stable", "release", etc
 * named branches are labeled on the plot
 * column width can be adjusted to handle repos with many concurrently open anonymous branches
 * plot width is increased automatically to fit necessary columns

The integration of the functionality is structured in a manner similar to what the "graph" command does (data flow from browser to backend and back), to ease review and avoid reinventing something that works.

I implemented a new command instead of modifying the "graph" command because:
 * i thought it to be less invasive to integrate
 * i suppose someone could prefer the original graph functionality
 * the code for the backend was almost rewritten, since it has a radically different and complex approach, so there was not much to reuse apart from the upper layers.

It has decent performance and has been used internally since april/may.
The HTML part could be probably improved, it's not my area of expertise, but should work well enough.

Configuration is simple. In repo .hg/hgrc put:

[web]
plot_pivot_branches = default, release


More information about the Mercurial-devel mailing list