[PATCH 2 of 2] hgewb: disable progress when serving (issue4582)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Jun 7 22:08:07 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1433722457 25200
#      Sun Jun 07 17:14:17 2015 -0700
# Node ID 1b7e8e1e3b91b073b670bf3dba9013e9b8cd9a95
# Parent  567035f46c6e91ef9420739bb7f21b7e3b9a6d10
hgewb: disable progress when serving (issue4582)

Before this patch, progress bar could be displayed when serving, creating
hypothetical problems.

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
@@ -67,10 +67,14 @@ class hgweb(object):
         r = self._getview(r)
         r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
         r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
         r.ui.setconfig('ui', 'nontty', 'true', 'hgweb')
         r.baseui.setconfig('ui', 'nontty', 'true', 'hgweb')
+        # displaying bundling progress bar while serving feel wrong and may
+        # break some wsgi implementation.
+        r.ui.setconfig('progress', 'disable', 'true', 'hgweb')
+        r.baseui.setconfig('progress', 'disable', 'true', 'hgweb')
         self.repo = r
         hook.redirect(True)
         self.repostate = ((-1, -1), (-1, -1))
         self.mtime = -1
         self.reponame = name
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
@@ -96,10 +96,13 @@ class hgwebdir(object):
             u = self.baseui.copy()
         else:
             u = ui.ui()
             u.setconfig('ui', 'report_untrusted', 'off', 'hgwebdir')
             u.setconfig('ui', 'nontty', 'true', 'hgwebdir')
+            # displaying bundling progress bar while serving feel wrong and may
+            # break some wsgi implementation.
+            u.setconfig('progress', 'disable', 'true', 'hgweb')
 
         if not isinstance(self.conf, (dict, list, tuple)):
             map = {'paths': 'hgweb-paths'}
             if not os.path.exists(self.conf):
                 raise util.Abort(_('config file %s not found!') % self.conf)


More information about the Mercurial-devel mailing list