[BUG] sections in TreeConfig not read properly

James Westby jw+debian at jameswestby.net
Sun Jun 17 22:46:39 BST 2007


Hi,

I am trying to move builddeb to use .bzr/branch/branch.conf, and so I am
using TreeConfig objects. I have a [BUILDDEB] section for the options,
but this does not currently work correctly, as options inside sections
are not handled as they should be. The fix appears to be simple and
obvious, but bzrlib/tests/test_config.py confuses me. There is no direct
tests for TreeConfig, and I can't really work out how BranchConfig is
tested.

Could someone point me in a way to write a test for this, or polish it
up themselves for inclusion. I include a diff for the fix below.

Thanks,

James

=== modified file 'bzrlib/config.py'
--- bzrlib/config.py    2007-04-05 09:35:26 +0000
+++ bzrlib/config.py    2007-06-17 21:29:50 +0000
@@ -852,7 +852,7 @@
             obj = self._get_config()
             try:
                 if section is not None:
-                    obj[section]
+                    obj = obj[section]
                 result = obj[name]
             except KeyError:
                 result = default

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256



More information about the bazaar mailing list