hgweb: alias ui module as uimod
authorYuya Nishihara <yuya@tcha.org>
Sun, 01 Nov 2015 13:58:32 +0900
changeset 27007 c8cbef073645
parent 27006 9d58dc193c46
child 27008 7f19f331ef59
hgweb: alias ui module as uimod It will be enforced by the import checker.
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/hgweb_mod.py	Tue Nov 17 14:23:26 2015 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Nov 01 13:58:32 2015 +0900
@@ -8,7 +8,8 @@
 
 import contextlib
 import os
-from mercurial import ui, hg, hook, error, encoding, templater, util, repoview
+from mercurial import hg, hook, error, encoding, templater, util, repoview
+from mercurial import ui as uimod
 from mercurial.templatefilters import websub
 from common import ErrorResponse, permhooks, caching
 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST
@@ -195,7 +196,7 @@
             if baseui:
                 u = baseui.copy()
             else:
-                u = ui.ui()
+                u = uimod.ui()
             r = hg.repository(u, repo)
         else:
             # we trust caller to give us a private copy
--- a/mercurial/hgweb/hgwebdir_mod.py	Tue Nov 17 14:23:26 2015 -0800
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Nov 01 13:58:32 2015 +0900
@@ -8,7 +8,8 @@
 
 import os, re, time
 from mercurial.i18n import _
-from mercurial import ui, hg, scmutil, util, templater
+from mercurial import hg, scmutil, util, templater
+from mercurial import ui as uimod
 from mercurial import error, encoding
 from common import ErrorResponse, get_mtime, staticfile, paritygen, ismember, \
                    get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
@@ -108,7 +109,7 @@
         if self.baseui:
             u = self.baseui.copy()
         else:
-            u = ui.ui()
+            u = uimod.ui()
             u.setconfig('ui', 'report_untrusted', 'off', 'hgwebdir')
             u.setconfig('ui', 'nontty', 'true', 'hgwebdir')
             # displaying bundling progress bar while serving feels wrong and may
--- a/mercurial/hgweb/webutil.py	Tue Nov 17 14:23:26 2015 -0800
+++ b/mercurial/hgweb/webutil.py	Sun Nov 01 13:58:32 2015 +0900
@@ -8,7 +8,8 @@
 
 import os, copy
 import re
-from mercurial import match, patch, error, ui, util, pathutil, context
+from mercurial import match, patch, error, util, pathutil, context
+from mercurial import ui as uimod
 from mercurial.i18n import _
 from mercurial.node import hex, nullid, short
 from mercurial.templatefilters import revescape
@@ -537,7 +538,7 @@
             yield {'name': key, 'value': str(value), 'separator': separator}
             separator = '&'
 
-class wsgiui(ui.ui):
+class wsgiui(uimod.ui):
     # default termwidth breaks under mod_wsgi
     def termwidth(self):
         return 80