Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 8200:865d2c646f29
ui: assumetrusted -> trust
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Apr 2009 16:50:44 -0500 |
parents | e9f90e5989d9 |
children | 7cf2b987acd3 |
comparison
equal
deleted
inserted
replaced
8199:e9f90e5989d9 | 8200:865d2c646f29 |
---|---|
31 self.trusted_groups = src.trusted_groups.copy() | 31 self.trusted_groups = src.trusted_groups.copy() |
32 self.fixconfig() | 32 self.fixconfig() |
33 else: | 33 else: |
34 # we always trust global config files | 34 # we always trust global config files |
35 for f in util.rcpath(): | 35 for f in util.rcpath(): |
36 self.readconfig(f, assumetrusted=True) | 36 self.readconfig(f, trust=True) |
37 def copy(self): | 37 def copy(self): |
38 return ui(self) | 38 return ui(self) |
39 | 39 |
40 _isatty = None | 40 _isatty = None |
41 def isatty(self): | 41 def isatty(self): |
67 if self.report_untrusted: | 67 if self.report_untrusted: |
68 self.warn(_('Not trusting file %s from untrusted ' | 68 self.warn(_('Not trusting file %s from untrusted ' |
69 'user %s, group %s\n') % (f, user, group)) | 69 'user %s, group %s\n') % (f, user, group)) |
70 return False | 70 return False |
71 | 71 |
72 def readconfig(self, filename, root=None, assumetrusted=False, | 72 def readconfig(self, filename, root=None, trust=False, |
73 sections = None): | 73 sections = None): |
74 try: | 74 try: |
75 fp = open(filename) | 75 fp = open(filename) |
76 except IOError: | 76 except IOError: |
77 if not sections: # ignore unless we were looking for something | 77 if not sections: # ignore unless we were looking for something |
78 return | 78 return |
79 raise | 79 raise |
80 | 80 |
81 cdata = config.config() | 81 cdata = config.config() |
82 trusted = sections or assumetrusted or self._is_trusted(fp, filename) | 82 trusted = sections or trust or self._is_trusted(fp, filename) |
83 | 83 |
84 try: | 84 try: |
85 cdata.read(filename, fp, sections=sections) | 85 cdata.read(filename, fp, sections=sections) |
86 except error.ConfigError, inst: | 86 except error.ConfigError, inst: |
87 if trusted: | 87 if trusted: |