hgweb: remove some accesses to private member uimod._unset
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 05 Aug 2020 13:33:07 -0700
changeset 45314 d12fba074cc6
parent 45313 fef64d7a4a84
child 45315 2901133ec982
hgweb: remove some accesses to private member uimod._unset Differential Revision: https://phab.mercurial-scm.org/D8897
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Thu Jul 30 21:36:29 2020 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Aug 05 13:33:07 2020 -0700
@@ -151,23 +151,21 @@
         self.csp, self.nonce = cspvalues(self.repo.ui)
 
     # Trust the settings from the .hg/hgrc files by default.
-    def config(self, section, name, default=uimod._unset, untrusted=True):
-        return self.repo.ui.config(section, name, default, untrusted=untrusted)
+    def config(self, *args, **kwargs):
+        kwargs.setdefault('untrusted', True)
+        return self.repo.ui.config(*args, **kwargs)
 
-    def configbool(self, section, name, default=uimod._unset, untrusted=True):
-        return self.repo.ui.configbool(
-            section, name, default, untrusted=untrusted
-        )
+    def configbool(self, *args, **kwargs):
+        kwargs.setdefault('untrusted', True)
+        return self.repo.ui.configbool(*args, **kwargs)
 
-    def configint(self, section, name, default=uimod._unset, untrusted=True):
-        return self.repo.ui.configint(
-            section, name, default, untrusted=untrusted
-        )
+    def configint(self, *args, **kwargs):
+        kwargs.setdefault('untrusted', True)
+        return self.repo.ui.configint(*args, **kwargs)
 
-    def configlist(self, section, name, default=uimod._unset, untrusted=True):
-        return self.repo.ui.configlist(
-            section, name, default, untrusted=untrusted
-        )
+    def configlist(self, *args, **kwargs):
+        kwargs.setdefault('untrusted', True)
+        return self.repo.ui.configlist(*args, **kwargs)
 
     def archivelist(self, nodeid):
         return webutil.archivelist(self.repo.ui, nodeid)
--- a/mercurial/hgweb/hgwebdir_mod.py	Thu Jul 30 21:36:29 2020 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Wed Aug 05 13:33:07 2020 -0700
@@ -537,8 +537,9 @@
         return res.sendresponse()
 
     def templater(self, req, nonce):
-        def config(section, name, default=uimod._unset, untrusted=True):
-            return self.ui.config(section, name, default, untrusted)
+        def config(*args, **kwargs):
+            kwargs.setdefault('untrusted', True)
+            return self.ui.config(*args, **kwargs)
 
         vars = {}
         styles, (style, mapfile) = hgweb_mod.getstyle(