# HG changeset patch # User RhodeCode Admin # Date 2023-12-28 14:08:47 # Node ID cb9d8354902717a6b0c280a31ccde3f5239a85c8 # Parent 2c7f5b16bf29301c1bad2113b24239f77d53c8a3 fix(mercurial): dropped support for depreacted hgsubversion fixes RCCE-12 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)