# HG changeset patch # User Yuya Nishihara # Date 2015-11-01 04:58:32 # Node ID c8cbef0736457af895721ffbc09e60e98a5c772c # Parent 9d58dc193c463f1513008bda73724d616cbb1c14 hgweb: alias ui module as uimod It will be enforced by the import checker. 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 @@ -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 @@ class hgweb(object): 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 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 @@ -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 @@ class hgwebdir(object): 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 diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -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 @@ class sessionvars(object): 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