hgwebdir not following symlinks

Johannes Totz jtotz at imperial.ac.uk
Fri Apr 16 19:00:14 CDT 2010


On 15/04/2010 18:49, paul.boddie at biotek.uio.no wrote:
> Johannes Totz wrote:
>>
>> I'm having trouble with hgwebdir and symlinks: when generating the index
>> page (with all the repos available) it doesn't list any symlinked repos.
>> Trying to access a symlinked repo directly via URL gets my an error
>> message. Might be related to nesting repos...
>>
>> E.g.
>> 1) https://server/hg/repo works
>> 2) https://server/hg/symlinkedrepo works
>> 3) https://server/hg/repo/symlinkedrepo does not (output is for repo
>> instead)
>> 4) https://server/hg/repo/symlinkeddir/repo2 does not (title of page is
>> for repo, content says "An error occurred while processing your
>> request: 00manifest.i at repo2: no match found")
> 
> It would be interesting to know how Apache is configured for hgwebdir and
> what your hgweb.config file contains. Certainly, a correctly configured
> hgwebdir serving content under https://server/hg/ should be able to
> provide both kinds of repositories. (I've just tested this, in fact.)

I think I've figured out what is going on.
The symlinks are actually pointing to locations under the same directory
tree, so Mercurial would find the same repo twice (and I would like it
to list it twice, just with different paths).
But in walkrepos in util.py there's a check that tests whether any
directory is been visited before. I suppose that is used to break cycles?

I will try to hack it and see how it goes...

> 
>> 5) https://server/hg/repo/dir/symlinkedrepo does not (lists repos in
>> repo/dir/)
>> 6) https://server/hg/repo/nestedrepo works
>>
>>
>> This is running Apache2 with hg version 1.5, and hgwebdir works fine
>> otherwise. Apache's FollowSymLinks option is on, and looking at the
>> code of walkrepos in util.py this should work (my Python skills are
>> pretty bad though).
>>
>> Any ideas how to debug this?
> 
> The mention of FollowSymLinks makes me wonder whether your repositories
> are situated under the document root (or equivalent) of the Web server.

To be honest, I can't really answer that question. The server is not
under my direct control. But I think that might be the case...

Thanks anyway!

> With hgwebdir, only the hgwebdir.cgi script needs to reside in a location
> known to the Web server - you are not actually meant to be publishing the
> repository directories directly (as static files) with Apache.
> 
> Two parts of the Wiki documentation are pertinent:
> 
> Firstly, setting up the hgweb.config file - I imagine that using
> collections of repositories is most convenient in this situation:
> 
> http://mercurial.selenic.com/wiki/PublishingRepositories#Publishing_Multiple_Repositories
> 
> Secondly, setting up the Apache configuration. Here, only the hgwebdir.cgi
> script needs to be known to Apache - only the script itself needs to know
> about where the repositories are:
> 
> http://mercurial.selenic.com/wiki/PublishingRepositories#Configuring_Apache
> 
> Apologies if you're doing the right thing already here, but I'm rather
> suspicious of Web server configuration and the numerous side-effects that
> can make people believe that a problem resides in one place when really
> it's the Web server being "helpful".
> 
> Paul
> 




More information about the Mercurial mailing list