Extending the hgweb interface

Matt Mackall mpm at selenic.com
Wed Oct 19 20:27:35 UTC 2011


On Wed, 2011-10-19 at 22:06 +0200, Remy Blank wrote:
> Thomas Lotze wrote:
> > I'd like to add another view to the hgweb interface for an hg repository.
> 
> Heh, good timing, I'm trying to do exactly the same. Unfortunately,
> hgweb hasn't been designed for easy extensibility. Be prepared for some
> data injection and monkey-patching tricks. In particular, the templates
> for the various styles more or less hardcode the menu entries, so adding
> a new one in a style-neutral way is difficult.
> 
> I'm all ears to be contradicted and shown how to do it properly :)

You're right, the 'menus' are hardcoded. Which means 'properly' is
introducing a menu template.

But here at the height of the Web 2.0 era though, what should probably
happen is a) we should add a generic JSON[1] template (much like the
existing raw template) and b) we should implement a second template that
presents a dynamic AJAX interface to it. This can probably all be done
without doing more to the template engine than adding a 'json' method.

(This will require the efforts of someone who can stomach the
grotesquery of modern web development.)

[1] with careful thought given to the encoding issues this involves
-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list