comparison mercurial/ui.py @ 8193:94246e90081e

config: add section filter to read move section filtering out of ui.readconfig kill section filtering in config.update
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Apr 2009 16:50:43 -0500
parents 9b8ac5fb7760
children b7c85a809a54
comparison
equal deleted inserted replaced
8192:5fd8e60a935d 8193:94246e90081e
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 assumetrusted or self._is_trusted(fp, filename)
83 83
84 try: 84 try:
85 cdata.read(filename, fp) 85 cdata.read(filename, fp, sections=sections)
86 except error.ConfigError, inst: 86 except error.ConfigError, inst:
87 if trusted: 87 if trusted:
88 raise 88 raise
89 self.warn(_("Ignored: %s\n") % str(inst)) 89 self.warn(_("Ignored: %s\n") % str(inst))
90 90
91 if trusted: 91 if trusted:
92 self.cdata.update(cdata, sections) 92 self.cdata.update(cdata)
93 self.cdata.update(self.overlay, sections) 93 self.cdata.update(self.overlay)
94 self.ucdata.update(cdata, sections) 94 self.ucdata.update(cdata)
95 self.ucdata.update(self.overlay, sections) 95 self.ucdata.update(self.overlay)
96 96
97 if root is None: 97 if root is None:
98 root = os.path.expanduser('~') 98 root = os.path.expanduser('~')
99 self.fixconfig(root=root) 99 self.fixconfig(root=root)
100 100