diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -371,6 +371,7 @@ def make_ui(repo_path=None): else: log.debug('hgrc file is not present at %s, skipping...', hgrc_path) + assert baseui.plain() # set by hgcompat.monkey_do (invoked from import of vcs.backends.hg) to minimize potential impact of loading config files return baseui diff --git a/kallithea/lib/vcs/utils/hgcompat.py b/kallithea/lib/vcs/utils/hgcompat.py --- a/kallithea/lib/vcs/utils/hgcompat.py +++ b/kallithea/lib/vcs/utils/hgcompat.py @@ -2,6 +2,7 @@ Mercurial libs compatibility """ +import mercurial.encoding import mercurial.localrepo @@ -11,3 +12,6 @@ def monkey_do(): mercurial.localrepo.localrepository._lfstatuswriters = [lambda *msg, **opts: None] # 3.5 7699d3212994 added the invariant that repo.lfstatus must exist before hitting overridearchive mercurial.localrepo.localrepository.lfstatus = False + + # Minimize potential impact from custom configuration + mercurial.encoding.environ[b'HGPLAIN'] = b'1'