Commit 8ce62d5e authored by Vincent Pelletier's avatar Vincent Pelletier

Merge branch 'bug_605017'

Conflicts:
	src/zc/buildout/tests.py
parents 22dfd469 f0bb1e70
......@@ -1312,6 +1312,7 @@ class Options(UserDict.DictMixin):
if '<' in self._raw:
self._raw = self._do_extend_raw(name, self._raw, [])
self._raw.pop('<')
# force substitutions
for k, v in self._raw.items():
......@@ -1340,7 +1341,7 @@ class Options(UserDict.DictMixin):
raise zc.buildout.UserError("Infinite extending loop %r" % name)
doing.append(name)
try:
to_do = data.pop('<', None)
to_do = data.get('<', None)
if to_do is None:
return data
__doing__ = 'Loading input sections for %r', name
......
......@@ -3702,6 +3702,102 @@ def bug_664539_recipe_updating_options_dict():
data='${value}'
recipe='zc.buildout:debug'
"""
def test_other_section_extend_precedence():
r"""
>>> write('buildout.cfg', '''
... [buildout]
... parts = myfiles
...
... [debug]
... recipe = zc.buildout:debug
... file1 = ${:path}/file1
... color = red
...
... [myfiles]
... <= debug
... path = mydata
... color = green
... ''')
>>> print system(buildout),
Installing myfiles.
color='green'
file1='mydata/file1'
path='mydata'
recipe='zc.buildout:debug'
"""
def test_same_section_extend_precedence():
r"""
>>> write('bar.cfg', '''
... [myfiles]
... recipe = zc.buildout:debug
... file1 = ${:path}/file1
... color = red
... ''')
>>> write('buildout.cfg', '''
... [buildout]
... extends = bar.cfg
... parts = myfiles
...
... [myfiles]
... path = mydata
... color = green
... ''')
>>> print system(buildout),
Installing myfiles.
color='green'
file1='mydata/file1'
path='mydata'
recipe='zc.buildout:debug'
"""
def bug_605017_reuse_extending_section():
r"""
>>> write('buildout.cfg', '''
... [buildout]
... parts = myfiles
... myfiles2
...
... [debug]
... recipe = zc.buildout:debug
...
... [with_file1]
... <= debug
... file1 = ${:path}/file1
... color = red
...
... [with_file2]
... <= debug
... file2 = ${:path}/file2
... color = blue
...
... [myfiles]
... <= with_file1
... with_file2
... path = mydata
...
... [myfiles2]
... <= with_file1
... with_file2
... path = mydata2
... ''')
>>> print system(buildout),
Installing myfiles.
color='blue'
file1='mydata/file1'
file2='mydata/file2'
path='mydata'
recipe='zc.buildout:debug'
Installing myfiles2.
color='blue'
file1='mydata2/file1'
file2='mydata2/file2'
path='mydata2'
recipe='zc.buildout:debug'
"""
######################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment