Current state of the art in sharing repositories via SSH

Matt Mackall mpm at selenic.com
Tue Jun 28 14:15:26 CDT 2011


On Tue, 2011-06-28 at 19:40 +0100, Tom Anderson wrote:
> It seems a shame that the ACL extension can't be used with a shared
> account. I've had a look at the code, and it looks like it wouldn't be
> that hard to make it possible (famous last words). There's a bit in
> the main hook() function that says:
> 
>     user = None
>     if source == 'serve' and 'url' in kwargs:
>         url = kwargs['url'].split(':')
>         if url[0] == 'remote' and url[1].startswith('http'):
>             user = urllib.unquote(url[3])
> 
>     if user is None:
>         user = getpass.getuser()
> 
> A couple of lines in there could look for some sort of effective
> username defined somewhere, and if it's set, use it.

As it happens, Mercurial (and Python) will honor the LOGNAME environment
variable here today:

$ LOGNAME=foo python -c 'import getpass; print getpass.getuser()'
foo

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list