Mercurial > public > mercurial-scm > hg
diff mercurial/ui.py @ 3677:1a0fa3914c46
Avoid looking up usernames if the current user owns the .hgrc file
Converting uids into usernames may be somewhat expensive when NIS
or LDAP is involved.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 18 Nov 2006 23:51:14 -0200 |
parents | d94664748bc1 |
children | 7e622c9a9707 |
line wrap: on
line diff
--- a/mercurial/ui.py Sat Nov 18 23:51:13 2006 -0200 +++ b/mercurial/ui.py Sat Nov 18 23:51:14 2006 -0200 @@ -96,10 +96,12 @@ def _is_trusted(self, fp, f, warn=True): if not self.check_trusted: return True + st = util.fstat(fp) + if util.isowner(fp, st): + return True tusers = self.trusted_users tgroups = self.trusted_groups if (tusers or tgroups) and '*' not in tusers and '*' not in tgroups: - st = util.fstat(fp) user = util.username(st.st_uid) group = util.groupname(st.st_gid) if user not in tusers and group not in tgroups: