# HG changeset patch # User Mads Kiilerich # Date 2018-09-30 18:31:37 # Node ID e885a8efef34dc969a58db842421732d678f24a5 # Parent fb493f3ed4e3048055c1800db9f93c65b3a92e54 tests: fix vcs Hg helper function get_config_value to not modify global state when using a custom config file This leak was what made test_get_user_name and test_get_user_email pass when test_get_config_value had been run first. diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py +++ b/kallithea/lib/vcs/backends/hg/repository.py @@ -602,8 +602,10 @@ class MercurialRepository(BaseRepository config_file = [config_file] config = self._repo.ui - for path in config_file: - config.readconfig(path) + if config_file: + config = ui.ui() + for path in config_file: + config.readconfig(path) return config.config(section, name) def get_user_name(self, config_file=None):