views:

794

answers:

3

Hi,

TortoiseHg web server configuration has an "Allow Push" parameter where I put the users allowed to push changes. But when I try to push I get an "authorization failed" error. How are the users authenticated? Where do the passwords come from?

+3  A: 

Setting allow_push = * will allow anybody to push to your repository served with hg serve. You should of course only do that on a trusted network. Apart from that, you cannot do authentication with hg serve -- you need a webserver in front of it that will authenticate users.

Please see hgrc for a terse explanation of allow_push and the wiki for a slightly longer explanation about what hg serve is for.

Martin Geisler
Thanks for answering Martin.They say:"...the authenticated user name must be present in this list (separated by whitespace or ,)"So do I have to put the user authenticated by the web server? I tried to put the user authenticated by Windows with no success.
Eduardo
Yes, you list the user authenticated by the webserver. Mercurial knows nothing about Windows: it only looks in the standard `REMOTE_USER` environment variable set by the webserver before the CGI script is envoked.
Martin Geisler
+1  A: 

I'm just getting into Mercurial, and from what I can tell (and read in the documentation), the TortoiseHg web server isn't meant to be a permanent solution. The docs seem to steer you towards running either Apache or lighttpd.

You may also want to check out Vampire Basic's tutorial on running Mercurial on Windows.

Peter Bernier
Since posting this I've gone through the tutorial linked to and am now successfully hosting Hudson via WinXP/IIS.
Peter Bernier
A: 

I believe you can just edit your hgrc file, under the [authorize] section: http://stackoverflow.com/questions/1997601/store-password-in-tortoisehg/1998637

Rob Conery