diff --git a/mercurial/hgweb/__init__.py b/mercurial/hgweb/__init__.py --- a/mercurial/hgweb/__init__.py +++ b/mercurial/hgweb/__init__.py @@ -8,8 +8,8 @@ import hgweb_mod, hgwebdir_mod -def hgweb(repo, name=None): - return hgweb_mod.hgweb(repo, name=name) +def hgweb(repo, name=None, baseui=None): + return hgweb_mod.hgweb(repo, name=name, baseui=baseui) def hgwebdir(config, baseui=None): return hgwebdir_mod.hgwebdir(config, baseui=baseui) 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 @@ -21,9 +21,12 @@ perms = { } class hgweb(object): - def __init__(self, repo, name=None): + def __init__(self, repo, name=None, baseui=None): if isinstance(repo, str): - u = ui.ui() + if baseui: + u = baseui.copy() + else: + u = ui.ui() u.setconfig('ui', 'report_untrusted', 'off') u.setconfig('ui', 'interactive', 'off') self.repo = hg.repository(u, repo)