hgweb: register web.comparisoncontext to the config table stable
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 09 Dec 2018 23:48:50 -0500
branchstable
changeset 53640 4265bfb53dd3c8961993a8af8a41691bcf03d6d7
parent 53584 47719d7c581f18c1e6c98b05e2f79307c2ea50bd
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
hgweb: register web.comparisoncontext to the config table This was caught in some server side logging added to debug py3 issues.
mercurial/configitems.py
mercurial/hgweb/webcommands.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1269,16 +1269,19 @@ coreconfigitem('web', 'allowzip',
     default=False,
 )
 coreconfigitem('web', 'archivesubrepos',
     default=False,
 )
 coreconfigitem('web', 'cache',
     default=True,
 )
+coreconfigitem('web', 'comparisoncontext',
+    default=5,
+)
 coreconfigitem('web', 'contact',
     default=None,
 )
 coreconfigitem('web', 'deny_push',
     default=list,
 )
 coreconfigitem('web', 'guessmime',
     default=False,
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -853,17 +853,17 @@ def comparison(web):
     if 'file' not in web.req.qsparams:
         raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
     path = webutil.cleanpath(web.repo, web.req.qsparams['file'])
 
     parsecontext = lambda v: v == 'full' and -1 or int(v)
     if 'context' in web.req.qsparams:
         context = parsecontext(web.req.qsparams['context'])
     else:
-        context = parsecontext(web.config('web', 'comparisoncontext', '5'))
+        context = parsecontext(web.config('web', 'comparisoncontext'))
 
     def filelines(f):
         if f.isbinary():
             mt = pycompat.sysbytes(
                 mimetypes.guess_type(pycompat.fsdecode(f.path()))[0]
                 or r'application/octet-stream')
             return [_('(binary file %s, hash: %s)') % (mt, hex(f.filenode()))]
         return f.data().splitlines()