From patchwork Fri Aug 2 14:15:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 6, RFC] ui.config: fix bug in config alternatives from cc669e4fec95 From: Augie Fackler X-Patchwork-Id: 1982 Message-Id: <123bd5dda28b5452afd8.1375452900@arthedain.pit.corp.google.com> To: mercurial-devel@selenic.com Date: Fri, 02 Aug 2013 10:15:00 -0400 # HG changeset patch # User Augie Fackler # Date 1374707619 14400 # Wed Jul 24 19:13:39 2013 -0400 # Node ID 123bd5dda28b5452afd8881488d14056f53ae421 # Parent a58251c0568fc5e86089a803ca75f75cc8c01678 ui.config: fix bug in config alternatives from cc669e4fec95 diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -176,7 +176,7 @@ alternates = [name] for n in alternates: - value = self._data(untrusted).get(section, name, None) + value = self._data(untrusted).get(section, n, None) if value is not None: name = n break @@ -184,10 +184,11 @@ value = default if self.debugflag and not untrusted and self._reportuntrusted: - uvalue = self._ucfg.get(section, name) - if uvalue is not None and uvalue != value: - self.debug("ignoring untrusted configuration option " - "%s.%s = %s\n" % (section, name, uvalue)) + for n in alternates: + uvalue = self._ucfg.get(section, n) + if uvalue is not None and uvalue != value: + self.debug("ignoring untrusted configuration option " + "%s.%s = %s\n" % (section, n, uvalue)) return value def configpath(self, section, name, default=None, untrusted=False):