diff --git a/vcsserver/scm_app.py b/vcsserver/scm_app.py --- a/vcsserver/scm_app.py +++ b/vcsserver/scm_app.py @@ -107,6 +107,18 @@ class HgWeb(mercurial.hgweb.hgweb_mod.hg return super()._runwsgi(req, res, repo) +def sanitize_hg_ui(baseui): + # NOTE(marcink): since python3 hgsubversion is deprecated. + # From old installations we might still have this set enabled + # we explicitly remove this now here to make sure it wont propagate further + + if baseui.config(b'extensions', b'hgsubversion') is not None: + for cfg in (baseui._ocfg, baseui._tcfg, baseui._ucfg): + if b'extensions' in cfg: + if b'hgsubversion' in cfg[b'extensions']: + del cfg[b'extensions'][b'hgsubversion'] + + def make_hg_ui_from_config(repo_config): baseui = mercurial.ui.ui() @@ -156,6 +168,7 @@ def create_hg_wsgi_app(repo_path, repo_n baseui = make_hg_ui_from_config(config) update_hg_ui_from_hgrc(baseui, repo_path) + sanitize_hg_ui(baseui) try: return HgWeb(safe_bytes(repo_path), name=safe_bytes(repo_name), baseui=baseui)