Rev 5579: Switch the default value of expand to False in config.get_user_option. in file:///home/vila/src/bzr/experimental/config/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Sat Feb 19 20:59:00 UTC 2011
At file:///home/vila/src/bzr/experimental/config/
------------------------------------------------------------
revno: 5579
revision-id: v.ladeuil+lp at free.fr-20110219205900-9wbukg1s2pb6b0xh
parent: v.ladeuil+lp at free.fr-20110218192410-e26rjil4fk2zkh06
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: expand-options
timestamp: Sat 2011-02-19 21:59:00 +0100
message:
Switch the default value of expand to False in config.get_user_option.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2011-02-18 11:33:53 +0000
+++ b/bzrlib/config.py 2011-02-19 20:59:00 +0000
@@ -323,7 +323,7 @@
"""Template method to provide a user option."""
return None
- def get_user_option(self, option_name, expand=True):
+ def get_user_option(self, option_name, expand=None):
"""Get a generic option - no special process, no default.
:param option_name: The queried option.
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2011-02-18 19:24:10 +0000
+++ b/bzrlib/tests/test_config.py 2011-02-19 20:59:00 +0000
@@ -604,7 +604,7 @@
list={foo},{bar},{baz}
''')
self.assertEquals(['start', 'middle', 'end'],
- conf.get_user_option('list'))
+ conf.get_user_option('list', expand=True))
def test_cascading_list(self):
conf = self.get_config('''
@@ -614,7 +614,7 @@
list={foo}
''')
self.assertEquals(['start', 'middle', 'end'],
- conf.get_user_option('list'))
+ conf.get_user_option('list', expand=True))
def test_pathological_hidden_list(self):
conf = self.get_config('''
@@ -628,7 +628,7 @@
# Nope, it's either a string or a list, and the list wins as soon as a
# ',' appears, so the string concatenation never occur.
self.assertEquals(['{foo', '}', '{', 'bar}'],
- conf.get_user_option('hidden'))
+ conf.get_user_option('hidden', expand=True))
class TestLocationConfigOptionExpansion(tests.TestCaseInTempDir):
@@ -650,7 +650,7 @@
bar = {foo}/2
''')
self.assertRaises(errors.ExpandingUnknownOption,
- c.get_user_option, 'bar')
+ c.get_user_option, 'bar', expand=True)
def test_cross_related_sections(self):
c = self.get_config('/project/branch/path','''
@@ -660,7 +660,7 @@
[/project/branch/path]
bar = {foo}ux
''')
- self.assertEquals('quux', c.get_user_option('bar'))
+ self.assertEquals('quux', c.get_user_option('bar', expand=True))
class TestIniBaseConfigOnDisk(tests.TestCaseInTempDir):
More information about the bazaar-commits
mailing list