changeset 33328:c8f212cb0c83

hgweb: use ui._unset to prevent a warning in configitems
author David Demelier <demelier.david@gmail.com>
date Mon, 03 Jul 2017 13:04:35 +0200
parents 68b7ceda99d7
children e714159860fd
files mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Fri Jul 07 00:13:53 2017 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Mon Jul 03 13:04:35 2017 +0200
@@ -119,19 +119,19 @@
         self.csp, self.nonce = cspvalues(self.repo.ui)
 
     # Trust the settings from the .hg/hgrc files by default.
-    def config(self, section, name, default=None, untrusted=True):
+    def config(self, section, name, default=uimod._unset, untrusted=True):
         return self.repo.ui.config(section, name, default,
                                    untrusted=untrusted)
 
-    def configbool(self, section, name, default=False, untrusted=True):
+    def configbool(self, section, name, default=uimod._unset, untrusted=True):
         return self.repo.ui.configbool(section, name, default,
                                        untrusted=untrusted)
 
-    def configint(self, section, name, default=None, untrusted=True):
+    def configint(self, section, name, default=uimod._unset, untrusted=True):
         return self.repo.ui.configint(section, name, default,
                                       untrusted=untrusted)
 
-    def configlist(self, section, name, default=None, untrusted=True):
+    def configlist(self, section, name, default=uimod._unset, untrusted=True):
         return self.repo.ui.configlist(section, name, default,
                                        untrusted=untrusted)
 
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 07 00:13:53 2017 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Jul 03 13:04:35 2017 +0200
@@ -404,7 +404,7 @@
                 except Exception as e:
                     u.warn(_('error reading %s/.hg/hgrc: %s\n') % (path, e))
                     continue
-                def get(section, name, default=None):
+                def get(section, name, default=uimod._unset):
                     return u.config(section, name, default, untrusted=True)
 
                 if u.configbool("web", "hidden", untrusted=True):