changeset 12690:94e7bd38d9a3

hgwebdir_mod: use fake termwidth to avoid mod_wsgi's wrath
author Augie Fackler <durin42@gmail.com>
date Sun, 10 Oct 2010 10:07:17 -0500
parents c52c629ce19e
children 1b1a9038a71a
files mercurial/hgweb/hgwebdir_mod.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Oct 10 10:06:36 2010 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Oct 10 10:07:17 2010 -0500
@@ -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')