comparison mercurial/ui.py @ 19536:ab3cf67740d6

ui.config: fix bug in config alternatives from cc669e4fec95
author Augie Fackler <durin42@gmail.com>
date Wed, 24 Jul 2013 19:13:39 -0400
parents c58b6ab4c26f
children e828975722c8
comparison
equal deleted inserted replaced
19535:df2155ebf502 19536:ab3cf67740d6
174 alternates = name 174 alternates = name
175 else: 175 else:
176 alternates = [name] 176 alternates = [name]
177 177
178 for n in alternates: 178 for n in alternates:
179 value = self._data(untrusted).get(section, name, None) 179 value = self._data(untrusted).get(section, n, None)
180 if value is not None: 180 if value is not None:
181 name = n 181 name = n
182 break 182 break
183 else: 183 else:
184 value = default 184 value = default
185 185
186 if self.debugflag and not untrusted and self._reportuntrusted: 186 if self.debugflag and not untrusted and self._reportuntrusted:
187 uvalue = self._ucfg.get(section, name) 187 for n in alternates:
188 if uvalue is not None and uvalue != value: 188 uvalue = self._ucfg.get(section, n)
189 self.debug("ignoring untrusted configuration option " 189 if uvalue is not None and uvalue != value:
190 "%s.%s = %s\n" % (section, name, uvalue)) 190 self.debug("ignoring untrusted configuration option "
191 "%s.%s = %s\n" % (section, n, uvalue))
191 return value 192 return value
192 193
193 def configpath(self, section, name, default=None, untrusted=False): 194 def configpath(self, section, name, default=None, untrusted=False):
194 'get a path config item, expanded relative to repo root or config file' 195 'get a path config item, expanded relative to repo root or config file'
195 v = self.config(section, name, default, untrusted) 196 v = self.config(section, name, default, untrusted)