--- a/mercurial/ui.py Sat Nov 18 23:51:14 2006 -0200
+++ b/mercurial/ui.py Sat Nov 18 23:51:15 2006 -0200
@@ -101,6 +101,11 @@
return True
tusers = self.trusted_users
tgroups = self.trusted_groups
+ if not tusers:
+ user = util.username()
+ if user is not None:
+ self.trusted_users[user] = 1
+ self.fixconfig(section='trusted')
if (tusers or tgroups) and '*' not in tusers and '*' not in tgroups:
user = util.username(st.st_uid)
group = util.groupname(st.st_gid)
@@ -203,14 +208,11 @@
self.interactive = self.configbool("ui", "interactive", True)
# update trust information
- if section is None or section == 'trusted':
- user = util.username()
- if user is not None:
+ if (section is None or section == 'trusted') and self.trusted_users:
+ for user in self.configlist('trusted', 'users'):
self.trusted_users[user] = 1
- for user in self.configlist('trusted', 'users'):
- self.trusted_users[user] = 1
- for group in self.configlist('trusted', 'groups'):
- self.trusted_groups[group] = 1
+ for group in self.configlist('trusted', 'groups'):
+ self.trusted_groups[group] = 1
def setconfig(self, section, name, value):
if not self.overlay: