how to setup a user with readonly access to all repositories?

Christophe Furmaniak christophe.furmaniak.ml at gmail.com
Mon Jan 10 10:56:14 CST 2011


my answer with a reply all

Ok, I've found why the reposettings did not work as I expected (because
reposettings is the good answer to my problem finaly :D).

The root path of my repositories is /DATA/HGROOT
So I had set the base value to /DATA/HGROOT in my reposettings config

[reposettings]
base = /DATA/HGROOT

BUT, actually, /DATA is a symbolic link to /LIBRE

The reposettings is comparing the path of a repo configured using the base
var to the one provided by mercurial (through the readconfig "method"), so
it was comparing

/DATA/HGROOT/myrepo with /LIBRE/HGROOT/myrepo that does not match

changing the base value to the real path (i.e. no symlink), it does work.

Maybe a comparison between the os.path.realpath of each path could solve the
issue.
I may send a pull request later :)

regards

Christophe

2011/1/9 Mads Kiilerich <mads at kiilerich.com>

> Christophe Furmaniak wrote, On 01/09/2011 02:21 PM:
>
>  Hi,
>>
>> I'd need to setup a special user with readonly access to all my
>> repositories (this need comes from a context of continuous integration with
>> a big (>300) number of repositories and a will to simplify the config).
>>
>> There is a simple way to do that, add my user (hgreadonly) to the
>> allow_read list for each repo.
>> I'd like to do it without having to setup this special user for each
>> repository.
>>
>
> You can perhaps put that configuration in the apache users .hgrc  - or in
> the global configuration. See http://selenic.com/hg/help/config .
>
> I assume all the repos are scripted somehow, so perhaps you could also
> simply tweak your scripts to set the right configuration for each repo.
>
> %include directives can make it quite dynamic - see
> http://www.selenic.com/mercurial/hgrc.5.html#syntax .
>
> /Mads
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20110110/5c28da6d/attachment.htm>


More information about the Mercurial mailing list