Patchwork [2,of,2] hgweb: register web.static to the config table

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 23, 2018, 1:24 p.m.
Message ID <d25a329a22d1521efa61.1537709051@mimosa>
Download mbox | patch
Permalink /patch/34950/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 23, 2018, 1:24 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1537686948 -32400
#      Sun Sep 23 16:15:48 2018 +0900
# Node ID d25a329a22d1521efa61fcfec7530b7f99d10a95
# Parent  021347195627de0eed504c548cb4e629000a4726
hgweb: register web.static to the config table

Otherwise we would got a develwarn.
Anton Shestakov - Sept. 24, 2018, 10:40 a.m.
On Sun, 23 Sep 2018 22:24:11 +0900
Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1537686948 -32400
> #      Sun Sep 23 16:15:48 2018 +0900
> # Node ID d25a329a22d1521efa61fcfec7530b7f99d10a95
> # Parent  021347195627de0eed504c548cb4e629000a4726
> hgweb: register web.static to the config table
> 
> Otherwise we would got a develwarn.

Queued, thanks!

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1352,6 +1352,9 @@  coreconfigitem('web', 'refreshinterval',
 coreconfigitem('web', 'server-header',
     default=None,
 )
+coreconfigitem('web', 'static',
+    default=None,
+)
 coreconfigitem('web', 'staticurl',
     default=None,
 )
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -383,8 +383,7 @@  class hgwebdir(object):
                     fname = virtual[7:]
                 else:
                     fname = req.qsparams['static']
-                static = self.ui.config("web", "static", None,
-                                        untrusted=False)
+                static = self.ui.config("web", "static", untrusted=False)
                 if not static:
                     tp = self.templatepath or templater.templatepaths()
                     if isinstance(tp, str):
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1221,7 +1221,7 @@  def static(web):
     fname = web.req.qsparams['file']
     # a repo owner may set web.static in .hg/hgrc to get any file
     # readable by the user running the CGI script
-    static = web.config("web", "static", None, untrusted=False)
+    static = web.config("web", "static", untrusted=False)
     if not static:
         tp = web.templatepath or templater.templatepaths()
         if isinstance(tp, str):