# HG changeset patch # User Alexis S. L. Carvalho # Date 1163901075 7200 # Node ID 7e622c9a9707b48acb95b6b95aaeb8d327ad1410 # Parent 1a0fa3914c46bad56c71c6c5f9fbec3123371520 Update trusted_users only after we've seen a file not owned by the user diff -r 1a0fa3914c46 -r 7e622c9a9707 mercurial/ui.py --- 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: