Specifying a per-repository hgrc file
I'm setting up a centrally hosted Mercurial repository. I would like to be able to define only a small set of users that 开发者_如何学Goare able to access that repository (maybe 3 or 4) - what do I need to write in the .hg/hgrc file that in order to make it work like this?
thanks, P
Mercurial doesn't provide a user authentication system -- that has to come from something else. However, it does provide an authorization system that uses the "who" answer from the external authentication system to decide what that "who" can do.
Popular external authentication systems include:
- HTTP authentication as provided by your web server (Apache, etc.)
- SSH authentication as provided by sshd
- file system level user authentication as provided by your operating system
- Note:
hg serve
does not have an authentication system, so it's not usable w/ per-user access controls
Accessing mercurial (either its web interface or its command line interface) through one of those systems, properly configured, provided mercurial with the answer to "who?".
Once Mercurial learns who is making the request then the allow_push
and allow_read
settings in the repository's .hg/hgrc
file will determine what that who can do.
So the how of setting this up depends on what means of access you're using, which is what Callahad was asking.
If you are sharing the repository through the Mercurial web interface, then read the Web interface configuration section of the hgrc man page.
精彩评论