Rev 5576: Some comment tweaks. in file:///home/vila/src/bzr/experimental/config/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Fri Feb 18 11:33:53 UTC 2011
At file:///home/vila/src/bzr/experimental/config/
------------------------------------------------------------
revno: 5576
revision-id: v.ladeuil+lp at free.fr-20110218113353-gpy8vejy9tzzwlog
parent: v.ladeuil+lp at free.fr-20110218112421-bd3tdaviyjbqbfkx
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: expand-options
timestamp: Fri 2011-02-18 12:33:53 +0100
message:
Some comment tweaks.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2011-02-18 11:24:21 +0000
+++ b/bzrlib/config.py 2011-02-18 11:33:53 +0000
@@ -271,7 +271,8 @@
for chunk in raw_chunks:
if not chunk_is_ref:
if chunk:
- # Keep only non-empty strings
+ # Keep only non-empty strings (or we get bogus empty
+ # slots when a list value is involved).
chunks.append(chunk)
chunk_is_ref = True
else:
@@ -293,8 +294,8 @@
# Once a list appears as the result of an expansion, all
# callers will get a list result. This allows a consistent
# behavior even when some options in the expansion chain
- # may be seen defined as strings even if their expanded
- # value is a list.
+ # defined as strings (no comma in their value) but their
+ # expanded value is a list.
return self._expand_options_in_list(chunks, env, _ref_stack)
else:
result = ''.join(chunks)
@@ -306,9 +307,11 @@
# anything else
value = env[name]
else:
- # FIXME: This is a limited implementation, what we really need
- # is a way to query the bzr config for the value of an option,
- # respecting the scope rules -- vila 20101222
+ # FIXME: This is a limited implementation, what we really need is a
+ # way to query the bzr config for the value of an option,
+ # respecting the scope rules (That is, once we implement fallback
+ # configs, getting the option value should restart from the top
+ # config, not the current one) -- vila 20101222
value = self.get_user_option(name, expand=False)
if isinstance(value, list):
value = self._expand_options_in_list(value, env, _ref_stack)
@@ -323,7 +326,6 @@
def get_user_option(self, option_name, expand=True):
"""Get a generic option - no special process, no default.
-
:param option_name: The queried option.
:param expand: Whether options references should be expanded.
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2011-02-18 11:24:21 +0000
+++ b/bzrlib/tests/test_config.py 2011-02-18 11:33:53 +0000
@@ -536,7 +536,7 @@
properly (yet).
"""
# FIXME: This should be rewritten when all configs share a storage
- # implementation.
+ # implementation -- vila 2011-02-18
def get_config(self, string=None):
if string is None:
More information about the bazaar-commits
mailing list