[PATCH 2 of 5 hgweb-thread-isolation] hgweb: don't make request optional

Gregory Szorc gregory.szorc at gmail.com
Tue Sep 1 14:11:08 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1440278560 25200
#      Sat Aug 22 14:22:40 2015 -0700
# Node ID 0a6b4dfb900e860684b8cc2df2788ad78e7f173a
# Parent  eea0ca94b0f571f117b62f4e7ebcc593fcf0bf73
hgweb: don't make request optional

The "request" argument has been optional in this code since
it was introduced in 38170eeed18c in 2009. There are no consumers that
don't pass this argument. So don't make it an optional argument.

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -137,9 +137,9 @@ class hgweb(object):
             return repo.filtered(viewconfig)
         else:
             return repo.filtered('served')
 
-    def refresh(self, request=None):
+    def refresh(self, request):
         repostate = []
         # file of interrests mtime and size
         for meth, fname in foi:
             prefix = getattr(self.repo, meth)
@@ -162,10 +162,10 @@ class hgweb(object):
             # update these last to avoid threads seeing empty settings
             self.repostate = repostate
             # mtime is needed for ETag
             self.mtime = st.st_mtime
-        if request:
-            self.repo.ui.environ = request.env
+
+        self.repo.ui.environ = request.env
 
     def run(self):
         """Start a server from CGI environment.
 


More information about the Mercurial-devel mailing list