[Checkins] SVN: zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/ Add support for multiple +/- increments in configs.

Ricardo Newbery ric at digitalmarbles.com
Mon Apr 25 18:21:06 EDT 2011


Log message for revision 121465:
  Add support for multiple +/- increments in configs.

Changed:
  U   zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/buildout.py
  U   zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/tests.py

-=-
Modified: zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/buildout.py	2011-04-25 22:16:29 UTC (rev 121464)
+++ zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/buildout.py	2011-04-25 22:21:06 UTC (rev 121465)
@@ -1495,14 +1495,14 @@
         v2, note2 = v
         if k.endswith('+'):
             key = k.rstrip(' +')
-            v1, note1 = s1.get(key, ("", ""))
+            v1, note1 = s2.get(key, s1.get(key, ("", "")))
             newnote = ' [+] '.join((note1, note2)).strip()
             s2[key] = "\n".join((v1).split('\n') +
                 v2.split('\n')), newnote
             del s2[k]
         elif k.endswith('-'):
             key = k.rstrip(' -')
-            v1, note1 = s1.get(key, ("", ""))
+            v1, note1 = s2.get(key, s1.get(key, ("", "")))
             newnote = ' [-] '.join((note1, note2)).strip()
             s2[key] = ("\n".join(
                 [v for v in v1.split('\n')

Modified: zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/tests.py	2011-04-25 22:16:29 UTC (rev 121464)
+++ zc.buildout/branches/newbery-multiple-increments/src/zc/buildout/tests.py	2011-04-25 22:21:06 UTC (rev 121465)
@@ -3494,10 +3494,13 @@
     ... x = 1
     ... y = a
     ...     b
+    ... z = A
+    ...     B
+    ...     C
     ...
     ... [p1]
     ... recipe = zc.buildout:debug
-    ... foo = ${buildout:x} ${buildout:y}
+    ... foo = ${buildout:x} ${buildout:y} ${buildout:z}
     ... ''')
 
     >>> write('buildout.cfg', '''
@@ -3506,6 +3509,8 @@
     ... parts += p2
     ... x += 2
     ... y -= a
+    ... z -= A
+    ... z += D
     ...
     ... [p2]
     ... <= p1
@@ -3513,10 +3518,10 @@
 
     >>> print system(buildout),
     Installing p1.
-      foo='1\n2 b'
+      foo='1\n2 b B\nC\nD'
       recipe='zc.buildout:debug'
     Installing p2.
-      foo='1\n2 b'
+      foo='1\n2 b B\nC\nD'
       recipe='zc.buildout:debug'
     """
 



More information about the checkins mailing list