[PATCH 14 of 23] configitems: register the 'web.encoding' config

Boris Feld boris.feld at octobus.net
Sat Sep 16 14:28:21 EDT 2017


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1498787144 -7200
#      ven. juin 30 03:45:44 2017 +0200
# Node ID e12b1ba1555714c6d24215faf25c955c6a5dabf4
# Parent  a51b26e8d3406c73676f14127bb637cd7fde357d
# EXP-Topic config.register.web
configitems: register the 'web.encoding' config

diff -r a51b26e8d340 -r e12b1ba15557 mercurial/configitems.py
--- a/mercurial/configitems.py	ven. juin 30 03:45:43 2017 +0200
+++ b/mercurial/configitems.py	ven. juin 30 03:45:44 2017 +0200
@@ -10,6 +10,7 @@
 import functools
 
 from . import (
+    encoding,
     error,
 )
 
@@ -618,6 +619,9 @@
 coreconfigitem('web', 'description',
     default="",
 )
+coreconfigitem('web', 'encoding',
+    default=lambda: encoding.encoding,
+)
 coreconfigitem('worker', 'backgroundclose',
     default=dynamicdefault,
 )
diff -r a51b26e8d340 -r e12b1ba15557 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	ven. juin 30 03:45:43 2017 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	ven. juin 30 03:45:44 2017 +0200
@@ -320,7 +320,7 @@
         rctx = requestcontext(self, repo)
 
         # This state is global across all threads.
-        encoding.encoding = rctx.config('web', 'encoding', encoding.encoding)
+        encoding.encoding = rctx.config('web', 'encoding')
         rctx.repo.ui.environ = req.env
 
         if rctx.csp:
diff -r a51b26e8d340 -r e12b1ba15557 mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	ven. juin 30 03:45:43 2017 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	ven. juin 30 03:45:44 2017 +0200
@@ -170,8 +170,7 @@
 
         self.repos = repos
         self.ui = u
-        encoding.encoding = self.ui.config('web', 'encoding',
-                                           encoding.encoding)
+        encoding.encoding = self.ui.config('web', 'encoding')
         self.style = self.ui.config('web', 'style', 'paper')
         self.templatepath = self.ui.config('web', 'templates', None)
         self.stripecount = self.ui.config('web', 'stripes', 1)


More information about the Mercurial-devel mailing list