hgwebdir directory walking

Kevin Berridge kevin.w.berridge at gmail.com
Tue Aug 11 17:24:01 CDT 2009

"mg" on the #mercurial IRC pointed me here.

I wonder if anyone would like to help me with a feature I'm interested 
in for hgwebdir.  I would like to use it to host a number of repos 
(using the /my/root/** syntax).  The catch is that I will be hosting A 
LOT of repos (each project has ~30 "modules" each of which is a repo, 
add feature branches on top of that and you're dealing with lots of 
repos).  Having many repos is not a problem in and of itself, the issue 
is that hgwebdir will list them all and there are just too many for this 
to be manageable. 

What would work better in this scenario would be if hgwebdir would just 
list directories and allow me to navigate through the directory 
structure by simply following the links.  The same way it works when you 
navigate the file system.

It almost already supports this.  For example, say you had 
/my/root/forestA/ and forestA contained 5 repos.  If you navigate to 
http://blah/repo/hgwebdir.cgi/my/root/forestA, it will list just the 5 
repos.  So it already supports parsing partial virtual paths, it just 
doesn't support listing directories instead of full repos.

I tried to update it to support this, but I don't know Python and I 
don't know hgweb's templating system, so I was unable to get it to 
work.  This paste shows the update I tried: 

Once I worked out all the parse errors it ran, but it just didn't list 

Any help or advice will be greatly appreciated!
Kevin Berridge

More information about the Mercurial-devel mailing list