# HG changeset patch # User Julien Cristau # Date 1412071234 -7200 # Node ID 9ecb271600fcf52ab18e529cd1ef28e92fe96307 # Parent a3373bf28ccbd84018e7e43fcee079ba02c7cb0c client: fix passing multiple config settings diff -r a3373bf28ccb -r 9ecb271600fc hglib/client.py --- a/hglib/client.py Fri Aug 01 18:24:32 2014 -0500 +++ b/hglib/client.py Tue Sep 30 12:00:34 2014 +0200 @@ -47,7 +47,8 @@ if path: self._args += ['-R', path] if configs: - self._args += ['--config'] + configs + for config in configs: + self._args += ['--config', config] self._env = {'HGPLAIN': '1'} if encoding: self._env['HGENCODING'] = encoding diff -r a3373bf28ccb -r 9ecb271600fc tests/test-config.py --- a/tests/test-config.py Fri Aug 01 18:24:32 2014 -0500 +++ b/tests/test-config.py Tue Sep 30 12:00:34 2014 +0200 @@ -25,3 +25,9 @@ self.assertTrue((os.path.abspath('.hg/hgrc') + ':2', 'section', 'key', 'value') in config) + +class test_config_arguments(common.basetest): + def test_basic(self): + client = hglib.open(configs=['diff.unified=5', 'a.b=foo']) + self.assertEqual(client.config('a'), [('a', 'b', 'foo')]) + self.assertEqual(client.config('diff'), [('diff', 'unified', '5')])