[PATCH 1 of 6 RFC] ui.config: fix bug in config alternatives from cc669e4fec95

Augie Fackler raf at durin42.com
Fri Aug 2 09:15:00 CDT 2013


# HG changeset patch
# User Augie Fackler <durin42 at gmail.com>
# 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):


More information about the Mercurial-devel mailing list