# HG changeset patch # User Mads Kiilerich # Date 1538325097 -7200 # 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 -r fb493f3ed4e3 -r e885a8efef34 kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py Sun Sep 30 18:29:55 2018 +0200 +++ b/kallithea/lib/vcs/backends/hg/repository.py Sun Sep 30 18:31:37 2018 +0200 @@ -602,8 +602,10 @@ 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):