[PATCH] hgweb: support multi-level repository indexes by enabling descend and collapse

Paul Boddie paul at boddie.org.uk
Thu Mar 8 17:31:53 CST 2012


On Thursday 08 March 2012 22:56:25 Matt Mackall wrote:
> On Thu, 2012-03-08 at 22:48 +0100, Paul Boddie wrote:
> > I wondered about how such things could be tested in the test suite: I
> > suppose I could just have the test obtain a page and have that compared
> > against some expected output, but isn't that a bit brittle?
>
> That's the usual approach, and generally works fine.

OK, I'll see how it goes. I see that there are already tests that produce 
HTML, and I guess that this works as long as the templater doesn't change the 
way it produces its output all by itself.

> What's the rationale for going to SVG?

You can template it with the existing mechanisms [*], and it doesn't involve 
the weird production and consumption of JSON, although the JSON is rather 
concise in comparison to the SVG output. I think the output itself looks 
nicer, and it's also more straightforward to style with CSS compared to the 
canvas-based stuff:

http://hgweb.boddie.org.uk/EventAggregator/graph

There are some limitations with respect to embedding SVG in a Web page - it 
has to be an XHTML page unless you serve the SVG as a separate resource and 
embed it using the object tag - but it does seem to function in modern 
browsers, and it also seems to print better, too, for those who have to 
produce hardcopy or PDFs.

I'm not advocating switching to SVG, but instead just adding support for it. 
It would be nice to somehow combine the data required by the different 
mechanisms into a single collection - currently, I just make another 
collection that the graph command exposes to the templater - so that if 
another way of generating graphs comes along (VRML?!), you could use that as 
well.

Paul

[*] 
http://hgweb.boddie.org.uk/MercurialWebTheme/file/ddde4ba0f47a/themes/mercurialweb/graphnode.tmpl


More information about the Mercurial-devel mailing list