Hi.

In my attempt to fix bug LP#605017, I broke "<=" precedence with patch on #2.
I now submitted patch on #5 which preserves precedence.

Also, I wrote attached tests for both extension forms:
- <= ...
- [buildout]\nextends = ...

Please commit them if they are welcome.
Note: I'm unsure of desired naming scheme, nor if there is any official naming 
unambiguously referring to each of those extensions, nor if it's the right 
file to put them in...

Regards,
-- 
Vincent Pelletier
ERP5 - open source ERP/CRM for flexible enterprises
From 257cbcc08bd7c6a37bef8731d6e87000c9cde8cd Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <[email protected]>
Date: Mon, 20 Feb 2012 18:20:19 +0100
Subject: [RFC 2/2] Extension precedence tests.

---
 src/zc/buildout/tests.py |   51 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/src/zc/buildout/tests.py b/src/zc/buildout/tests.py
index 5508068..dbaa600 100644
--- a/src/zc/buildout/tests.py
+++ b/src/zc/buildout/tests.py
@@ -3587,6 +3587,57 @@ def increment_on_command_line():
       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', '''
-- 
1.7.8.3

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to