changeset 132:9ecb271600fc

client: fix passing multiple config settings
author Julien Cristau <julien.cristau@logilab.fr>
date Tue, 30 Sep 2014 12:00:34 +0200
parents a3373bf28ccb
children b6f601ba7f3c
files hglib/client.py tests/test-config.py
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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')])