[PATCH 2 of 2] hgwebdir_mod: use fake termwidth to avoid mod_wsgi's wrath

Augie Fackler durin42 at gmail.com
Sun Oct 10 10:23:51 CDT 2010


# HG changeset patch
# User Augie Fackler <durin42 at gmail.com>
# Date 1286723237 18000
# Node ID e54df3afb735899e7a3a7bf59bbce73bf8b5280b
# Parent  6380f00fa4e6a3ef2522594a1a843900f3e52ec0
hgwebdir_mod: use fake termwidth to avoid mod_wsgi's wrath

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
@@ -41,6 +41,11 @@
             repos.append((name, path))
     return repos
 
+class wsgiui(ui.ui):
+    # default termwidth breaks under mod_wsgi
+    def termwidth(self):
+        return 80
+
 class hgwebdir(object):
     refreshinterval = 20
 
@@ -58,7 +63,7 @@
         if self.baseui:
             u = self.baseui.copy()
         else:
-            u = ui.ui()
+            u = wsgiui()
             u.setconfig('ui', 'report_untrusted', 'off')
             u.setconfig('ui', 'interactive', 'off')
 


More information about the Mercurial-devel mailing list