[PATCH 07 of 11] [RFC] Add support for environment variable HG_TRUSTED_USERS
Markus F.X.J. Oberhumer
markus at oberhumer.com
Mon Jun 25 12:50:44 UTC 2007
# HG changeset patch
# User Markus F.X.J. Oberhumer <markus at oberhumer.com>
# Date 1182775580 -7200
# Node ID da57c9e729038e4e10db387905f39c180210b869
# Parent 627752dddfa1b3d83363f9153b463034c3041ea5
[RFC] Add support for environment variable HG_TRUSTED_USERS.
Info: this is needed when using ssh shell access on sourceforge.net,
otherwise project group members will not trust some hgrc settings.
The remote "hg-team" shell script we use on sourceforge.net looks
like this:
#! /bin/sh
umask 002
# trust all users of our project group
HG_TRUSTED_USERS="user1,user2,user3"
export HG_TRUSTED_USERS
exec /PATH_TO_REAL_HG/hg ${1+"$@"}
And the local .hg/hgrc looks like this:
[ui]
remotecmd = /PATH_TO_HG_TEAM_ON_SOURCEFORGE_NET/hg-team
Finally the remote repository must have mode 0664 (i.e. g+rw) on all
files and mode 02771 (i.e. g+rwxs) on all directories.
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -58,6 +58,10 @@ class ui(object):
self.ucdata = dupconfig(self.parentui.ucdata)
if self.parentui.overlay:
self.overlay = dupconfig(self.parentui.overlay)
+ s = os.environ.get("HG_TRUSTED_USERS")
+ if s:
+ for u in filter(None, re.split(r"\s*,\s*", s)):
+ self.trusted_users[u] = 1
def __getattr__(self, key):
return getattr(self.parentui, key)
More information about the Mercurial-devel
mailing list