[RFC] branchview-NG
Dirkjan Ochtman
dirkjan at ochtman.nl
Tue Jun 17 07:48:19 CDT 2008
Hello all,
As some of you may have noticed, I've been working on an update for the
old branchview extension. Matt mentioned he liked the idea save for some
crappy implementation details, so I've been trying to reimplement the
idea without all of the crap that came with the old implementation. This
work is now more or less finished, so I was wondering if this could now
be included in mainline Mercurial as an addition to the web interface.
I worked from the old branchview code, but was able to replace pretty
much all the bits there (especially the dirty HTML drawing library and
the blob of bzr code that was trying to do some topology sorting.)
My example is here: http://hg.xavamedia.nl/mercurial/graph/graph.
Review the tip changeset to see how it's implemented. Basically, this
uses an adaptation of the (linear) graphlog algorithm to come up with
the graph, which is then converted to a JSON representation by a new
webcommand. A JavaScript class is included that draws the graph on a
browser canvas, which should work (and was tested) in Firefox, Safari
and Opera. For IE users, I've included ExplorerCanvas, an open source
(Apache 2.0) JavaScript library that exposes a canvas API based on IE's
VML implementation, which appears to work alright.
This means it works in all 4 major browsers, although the spacing isn't
perfect in IE (and the positioning could be a little in places in other
browsers, but I'm hoping others will step in and help improving that).
I've only added links and a template in the coal style for now, will add
the other ones if this is accepted. So, I'd like to know what you think!
Cheers,
Dirkjan
More information about the Mercurial-devel
mailing list