Commit a53abd21 authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

[fix] Fix +=/-= support for keys in the same file

Before this, += and -= worked correctly when applied to a key defined
in a file extended by the current file, but not when the key was in
the same file.

e.g.:

```
[part]
a = this case is
```

```
[buildout]
extends = a.cfg

[part]
a += ok
b = this case is
b += not-ok
```
Co-authored-by: Xavier Thompson's avatarXavier Thompson <xavier.thompson@nexedi.com>
parent 70993203
...@@ -2041,7 +2041,10 @@ def _update(d1, d2): ...@@ -2041,7 +2041,10 @@ def _update(d1, d2):
if section in d1: if section in d1:
_update_section(d1[section], d2[section]) _update_section(d1[section], d2[section])
else: else:
d1[section] = d2[section] # In order to process += (and -=) correctly when
# <key> = <value> and <key> += <value> are in the same section
# _update_section must be called even when section is not in d1
d1[section] = _update_section({}, d2[section])
return d1 return d1
def _recipe(options): def _recipe(options):
......
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