Mercurial > kallithea
changeset 7386:e885a8efef34
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 30 Sep 2018 18:31:37 +0200 |
parents | fb493f3ed4e3 |
children | c677d5839bcc |
files | kallithea/lib/vcs/backends/hg/repository.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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):