Commit c7f7e381 authored by gotcha's avatar gotcha

fix for annotate broken tests on Windows

git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@102240 62d5b8a3-27da-0310-9561-8e5933582275
parent 2d888211
...@@ -90,13 +90,21 @@ def _print_annotate(data): ...@@ -90,13 +90,21 @@ def _print_annotate(data):
keys = data[section].keys() keys = data[section].keys()
keys.sort() keys.sort()
for key in keys: for key in keys:
value, files = data[section][key] value, notes = data[section][key]
print "%s=%s" % (key, value) keyvalue = "%s= %s" % (key, value)
for file in files.split(): print keyvalue
print " " + file line = ' '
print for note in notes.split():
if note == '[+]':
line = '+= '
elif note == '[-]':
line = '-= '
else:
print line, note
line = ' '
print print
def _unannotate_section(section): def _unannotate_section(section):
for key in section: for key in section:
value, note = section[key] value, note = section[key]
...@@ -1323,14 +1331,14 @@ def _update_section(s1, s2): ...@@ -1323,14 +1331,14 @@ def _update_section(s1, s2):
if k.endswith('+'): if k.endswith('+'):
key = k.rstrip(' +') key = k.rstrip(' +')
v1, note1 = s1.get(key, ("", "")) v1, note1 = s1.get(key, ("", ""))
newnote = ' +'.join((note1, note2)).strip() newnote = ' [+] '.join((note1, note2)).strip()
s2[key] = "\n".join((v1).split('\n') + s2[key] = "\n".join((v1).split('\n') +
v2.split('\n')), newnote v2.split('\n')), newnote
del s2[k] del s2[k]
elif k.endswith('-'): elif k.endswith('-'):
key = k.rstrip(' -') key = k.rstrip(' -')
v1, note1 = s1.get(key, ("", "")) v1, note1 = s1.get(key, ("", ""))
newnote = ' -'.join((note1, note2)).strip() newnote = ' [-] '.join((note1, note2)).strip()
s2[key] = ("\n".join( s2[key] = ("\n".join(
[v for v in v1.split('\n') [v for v in v1.split('\n')
if v not in v2.split('\n')]), newnote) if v not in v2.split('\n')]), newnote)
......
...@@ -722,37 +722,36 @@ COMMAND_LINE_VALUE). ...@@ -722,37 +722,36 @@ COMMAND_LINE_VALUE).
================== ==================
<BLANKLINE> <BLANKLINE>
[buildout] [buildout]
bin-directory=bin bin-directory= bin
DEFAULT_VALUE DEFAULT_VALUE
develop=recipes develop= recipes
.../_TEST_/sample-buildout/buildout.cfg /sample-buildout/buildout.cfg
develop-eggs-directory=develop-eggs develop-eggs-directory= develop-eggs
DEFAULT_VALUE DEFAULT_VALUE
directory=.../_TEST_/sample-buildout directory= /sample-buildout
COMPUTED_VALUE COMPUTED_VALUE
eggs-directory=eggs eggs-directory= eggs
DEFAULT_VALUE DEFAULT_VALUE
executable=... executable= ...
DEFAULT_VALUE DEFAULT_VALUE
installed=.installed.cfg installed= .installed.cfg
DEFAULT_VALUE DEFAULT_VALUE
log-format= log-format=
DEFAULT_VALUE DEFAULT_VALUE
log-level=INFO log-level= INFO
DEFAULT_VALUE DEFAULT_VALUE
parts=data-dir parts= data-dir
.../_TEST_/sample-buildout/buildout.cfg /sample-buildout/buildout.cfg
parts-directory=parts parts-directory= parts
DEFAULT_VALUE DEFAULT_VALUE
python=buildout python= buildout
DEFAULT_VALUE DEFAULT_VALUE
<BLANKLINE> <BLANKLINE>
[data-dir] [data-dir]
path=foo bins path= foo bins
.../_TEST_/sample-buildout/buildout.cfg /sample-buildout/buildout.cfg
recipe=recipes:mkdir recipe= recipes:mkdir
.../_TEST_/sample-buildout/buildout.cfg /sample-buildout/buildout.cfg
<BLANKLINE>
<BLANKLINE> <BLANKLINE>
Variable substitutions Variable substitutions
...@@ -1083,34 +1082,34 @@ operations. ...@@ -1083,34 +1082,34 @@ operations.
... ...
<BLANKLINE> <BLANKLINE>
[part1] [part1]
option=a1 a2 option= a1 a2
a3 a4 a3 a4
a5 a5
.../_TEST_/sample-buildout/base.cfg /sample-buildout/base.cfg
+.../_TEST_/sample-buildout/extension1.cfg += /sample-buildout/extension1.cfg
+.../_TEST_/sample-buildout/extension2.cfg += /sample-buildout/extension2.cfg
recipe= recipe=
.../_TEST_/sample-buildout/base.cfg /sample-buildout/base.cfg
<BLANKLINE> <BLANKLINE>
[part2] [part2]
option=b1 b2 b3 b4 option= b1 b2 b3 b4
.../_TEST_/sample-buildout/base.cfg /sample-buildout/base.cfg
-.../_TEST_/sample-buildout/extension1.cfg -= /sample-buildout/extension1.cfg
-.../_TEST_/sample-buildout/extension2.cfg -= /sample-buildout/extension2.cfg
recipe= recipe=
.../_TEST_/sample-buildout/base.cfg /sample-buildout/base.cfg
<BLANKLINE> <BLANKLINE>
[part3] [part3]
option=c1 c2 option= c1 c2
c3 c4 c5 c3 c4 c5
.../_TEST_/sample-buildout/base.cfg /sample-buildout/base.cfg
+.../_TEST_/sample-buildout/extension1.cfg += /sample-buildout/extension1.cfg
recipe= recipe=
.../_TEST_/sample-buildout/base.cfg /sample-buildout/base.cfg
<BLANKLINE> <BLANKLINE>
[part4] [part4]
option=h1 h2 option= h1 h2
.../_TEST_/sample-buildout/extension1.cfg /sample-buildout/extension1.cfg
... ...
Cleanup. Cleanup.
......
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