equal
deleted
inserted
replaced
77 except error.ConfigError, inst: |
77 except error.ConfigError, inst: |
78 if trusted: |
78 if trusted: |
79 raise |
79 raise |
80 self.warn(_("Ignored: %s\n") % str(inst)) |
80 self.warn(_("Ignored: %s\n") % str(inst)) |
81 |
81 |
|
82 if self.plain(): |
|
83 for k in ('debug', 'fallbackencoding', 'quiet', 'traceback', |
|
84 'verbose'): |
|
85 if k in cfg['ui']: |
|
86 del cfg['ui'][k] |
|
87 for k, v in cfg.items('defaults'): |
|
88 del cfg['defaults'][k] |
|
89 |
82 if trusted: |
90 if trusted: |
83 self._tcfg.update(cfg) |
91 self._tcfg.update(cfg) |
84 self._tcfg.update(self._ocfg) |
92 self._tcfg.update(self._ocfg) |
85 self._ucfg.update(cfg) |
93 self._ucfg.update(cfg) |
86 self._ucfg.update(self._ocfg) |
94 self._ucfg.update(self._ocfg) |
166 def walkconfig(self, untrusted=False): |
174 def walkconfig(self, untrusted=False): |
167 cfg = self._data(untrusted) |
175 cfg = self._data(untrusted) |
168 for section in cfg.sections(): |
176 for section in cfg.sections(): |
169 for name, value in self.configitems(section, untrusted): |
177 for name, value in self.configitems(section, untrusted): |
170 yield section, name, str(value).replace('\n', '\\n') |
178 yield section, name, str(value).replace('\n', '\\n') |
|
179 |
|
180 def plain(self): |
|
181 return 'HGPLAIN' in os.environ |
171 |
182 |
172 def username(self): |
183 def username(self): |
173 """Return default username to be used in commits. |
184 """Return default username to be used in commits. |
174 |
185 |
175 Searched in this order: $HGUSER, [ui] section of hgrcs, $EMAIL |
186 Searched in this order: $HGUSER, [ui] section of hgrcs, $EMAIL |