Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 8345:dcebff8a25dd
hgwebdir: read --webdir-conf as actual configuration to ui (issue1586)
This cleans up code and allows specification of values more globally. For
example, it's now possible to specify web.contact in webdir-conf for all
repositories without a specified contact set.
author | Alexander Solovyov <piranha@piranha.org.ua> |
---|---|
date | Mon, 11 May 2009 14:20:18 +0200 |
parents | b87a50b7125c |
children | e84a8482c6f2 |
comparison
equal
deleted
inserted
replaced
8344:873429914ec5 | 8345:dcebff8a25dd |
---|---|
56 self.warn(_('Not trusting file %s from untrusted ' | 56 self.warn(_('Not trusting file %s from untrusted ' |
57 'user %s, group %s\n') % (f, user, group)) | 57 'user %s, group %s\n') % (f, user, group)) |
58 return False | 58 return False |
59 | 59 |
60 def readconfig(self, filename, root=None, trust=False, | 60 def readconfig(self, filename, root=None, trust=False, |
61 sections=None): | 61 sections=None, remap=None): |
62 try: | 62 try: |
63 fp = open(filename) | 63 fp = open(filename) |
64 except IOError: | 64 except IOError: |
65 if not sections: # ignore unless we were looking for something | 65 if not sections: # ignore unless we were looking for something |
66 return | 66 return |
68 | 68 |
69 cfg = config.config() | 69 cfg = config.config() |
70 trusted = sections or trust or self._is_trusted(fp, filename) | 70 trusted = sections or trust or self._is_trusted(fp, filename) |
71 | 71 |
72 try: | 72 try: |
73 cfg.read(filename, fp, sections=sections) | 73 cfg.read(filename, fp, sections=sections, remap=remap) |
74 except error.ConfigError, inst: | 74 except error.ConfigError, inst: |
75 if trusted: | 75 if trusted: |
76 raise | 76 raise |
77 self.warn(_("Ignored: %s\n") % str(inst)) | 77 self.warn(_("Ignored: %s\n") % str(inst)) |
78 | 78 |