changeset 12691:1b1a9038a71a

hgweb: fix hgweb_mod as well as hgwebdir_mod
author Augie Fackler <durin42@gmail.com>
date Sun, 10 Oct 2010 10:42:44 -0500
parents 94e7bd38d9a3
children 0ac7c5c8121a
files mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py mercurial/hgweb/webutil.py
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Sun Oct 10 10:07:17 2010 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Oct 10 10:42:44 2010 -0500
@@ -28,7 +28,7 @@
             if baseui:
                 u = baseui.copy()
             else:
-                u = ui.ui()
+                u = webutil.wsgiui()
             self.repo = hg.repository(u, repo)
         else:
             self.repo = repo
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Oct 10 10:07:17 2010 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Oct 10 10:42:44 2010 -0500
@@ -41,11 +41,6 @@
             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
 
@@ -63,7 +58,7 @@
         if self.baseui:
             u = self.baseui.copy()
         else:
-            u = wsgiui()
+            u = webutil.wsgiui()
             u.setconfig('ui', 'report_untrusted', 'off')
             u.setconfig('ui', 'interactive', 'off')
 
--- a/mercurial/hgweb/webutil.py	Sun Oct 10 10:07:17 2010 -0500
+++ b/mercurial/hgweb/webutil.py	Sun Oct 10 10:42:44 2010 -0500
@@ -7,7 +7,7 @@
 # GNU General Public License version 2 or any later version.
 
 import os, copy
-from mercurial import match, patch, util, error
+from mercurial import match, patch, util, error, ui
 from mercurial.node import hex, nullid
 
 def up(p):
@@ -219,3 +219,8 @@
         for key, value in self.vars.iteritems():
             yield {'name': key, 'value': str(value), 'separator': separator}
             separator = '&'
+
+class wsgiui(ui.ui):
+    # default termwidth breaks under mod_wsgi
+    def termwidth(self):
+        return 80