Patchwork [1,of,2,v4] hgweb: use ui._unset to get prevent a warning in configitems

login
register
mail settings
Submitter David Demelier
Date July 7, 2017, 6:37 a.m.
Message ID <d32ff523e0219b48b119.1499409451@fedy>
Download mbox | patch
Permalink /patch/22085/
State Accepted
Headers show

Comments

David Demelier - July 7, 2017, 6:37 a.m.
# HG changeset patch
# User David Demelier <demelier.david@gmail.com>
# Date 1499079875 -7200
#      Mon Jul 03 13:04:35 2017 +0200
# Node ID d32ff523e0219b48b119d9dc44d9d07638153a72
# Parent  5c9ad50fd62fbc2057ef7b44f921f22e7359af32
hgweb: use ui._unset to get prevent a warning in configitems
David Demelier - July 7, 2017, 6:38 a.m.
Sorry, small typo in the commit message. Next time I'll complete my
coffee before calling hg email.

Patch

diff -r 5c9ad50fd62f -r d32ff523e021 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Wed Jun 28 13:32:36 2017 +0200
+++ 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)
 
diff -r 5c9ad50fd62f -r d32ff523e021 mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Wed Jun 28 13:32:36 2017 +0200
+++ 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):