Commit c62669f4 authored by Godefroid Chapelle's avatar Godefroid Chapelle

verbose and section flags for annotate

--verbose allows, among others, to find out which values are overridden
when extending cfg files

--section allows to focus on a specific section
parent d6fba392
.installed.cfg .installed.cfg
bin/ bin/
build/ build/
include/
develop-eggs/ develop-eggs/
eggs/ eggs/
parts/ parts/
......
This diff is collapsed.
...@@ -809,7 +809,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``, ...@@ -809,7 +809,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``,
bin-directory= bin bin-directory= bin
DEFAULT_VALUE DEFAULT_VALUE
develop= recipes develop= recipes
/sample-buildout/buildout.cfg buildout.cfg
develop-eggs-directory= develop-eggs develop-eggs-directory= develop-eggs
DEFAULT_VALUE DEFAULT_VALUE
directory= /sample-buildout directory= /sample-buildout
...@@ -833,7 +833,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``, ...@@ -833,7 +833,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``,
offline= false offline= false
DEFAULT_VALUE DEFAULT_VALUE
parts= data-dir parts= data-dir
/sample-buildout/buildout.cfg buildout.cfg
parts-directory= parts parts-directory= parts
DEFAULT_VALUE DEFAULT_VALUE
prefer-final= true prefer-final= true
...@@ -853,9 +853,172 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``, ...@@ -853,9 +853,172 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``,
<BLANKLINE> <BLANKLINE>
[data-dir] [data-dir]
path= foo bins path= foo bins
/sample-buildout/buildout.cfg buildout.cfg
recipe= recipes:mkdir recipe= recipes:mkdir
/sample-buildout/buildout.cfg buildout.cfg
<BLANKLINE>
[versions]
zc.buildout = >=1.99
DEFAULT_VALUE
zc.recipe.egg = >=1.99
DEFAULT_VALUE
<BLANKLINE>
The ``annotate`` has a verbose flag. You get more information about the way values are computed::
>>> print_(system(buildout+ ' annotate --verbose'), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
<BLANKLINE>
[buildout]
allow-hosts= *
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = *
<BLANKLINE>
allow-picked-versions= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
bin-directory= bin
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = bin
<BLANKLINE>
develop= recipes
<BLANKLINE>
IN buildout.cfg
SET VALUE = recipes
<BLANKLINE>
develop-eggs-directory= develop-eggs
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = develop-eggs
<BLANKLINE>
directory= /sample-buildout
<BLANKLINE>
AS COMPUTED_VALUE
SET VALUE = /sample-buildout
<BLANKLINE>
eggs-directory= /sample-buildout/eggs
<BLANKLINE>
AS DEFAULT_VALUE
DIRECTORY VALUE = /sample-buildout/eggs
AS DEFAULT_VALUE
SET VALUE = eggs
<BLANKLINE>
executable= /Users/gotcha/co/buildout/bin/python
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = /Users/gotcha/co/buildout/bin/python
<BLANKLINE>
find-links=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
install-from-cache= false
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = false
<BLANKLINE>
installed= .installed.cfg
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = .installed.cfg
<BLANKLINE>
log-format=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
log-level= INFO
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = INFO
<BLANKLINE>
newest= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
offline= false
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = false
<BLANKLINE>
parts= data-dir
<BLANKLINE>
IN buildout.cfg
SET VALUE = data-dir
<BLANKLINE>
parts-directory= parts
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = parts
<BLANKLINE>
prefer-final= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
python= buildout
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = buildout
<BLANKLINE>
show-picked-versions= false
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = false
<BLANKLINE>
socket-timeout=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
update-versions-file=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
use-dependency-links= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
versions= versions
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = versions
<BLANKLINE>
<BLANKLINE>
[data-dir]
path= foo bins
<BLANKLINE>
IN buildout.cfg
SET VALUE = foo bins
<BLANKLINE>
recipe= recipes:mkdir
<BLANKLINE>
IN buildout.cfg
SET VALUE = recipes:mkdir
<BLANKLINE>
<BLANKLINE>
[versions]
...
The output of the ``annotate`` command can be very long.
You can restrict output to a single section with the ``--section`` flag::
>>> print_(system(buildout+ ' annotate --section=versions'), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
<BLANKLINE> <BLANKLINE>
[versions] [versions]
zc.buildout= >=1.99 zc.buildout= >=1.99
...@@ -1384,42 +1547,42 @@ operations:: ...@@ -1384,42 +1547,42 @@ operations::
option= a1 a2 option= a1 a2
a3 a4 a3 a4
a5 a5
/sample-buildout/base.cfg base.cfg
+= /sample-buildout/extension1.cfg += extension1.cfg
+= /sample-buildout/extension2.cfg += extension2.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part2] [part2]
option= b1 b2 b3 b4 option= b1 b2 b3 b4
/sample-buildout/base.cfg base.cfg
-= /sample-buildout/extension1.cfg -= extension1.cfg
-= /sample-buildout/extension2.cfg -= extension2.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part3] [part3]
option= c1 c2 option= c1 c2
c3 c4 c5 c3 c4 c5
/sample-buildout/base.cfg base.cfg
+= /sample-buildout/extension1.cfg += extension1.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part4] [part4]
option= d2 option= d2
d3 d3
d1 d1
d4 d4
/sample-buildout/base.cfg base.cfg
+= /sample-buildout/extension1.cfg += extension1.cfg
-= /sample-buildout/extension1.cfg -= extension1.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part5] [part5]
option= h1 h2 option= h1 h2
/sample-buildout/extension1.cfg extension1.cfg
[versions] [versions]
zc.buildout= >=1.99 zc.buildout= >=1.99
DEFAULT_VALUE DEFAULT_VALUE
...@@ -1427,6 +1590,77 @@ operations:: ...@@ -1427,6 +1590,77 @@ operations::
DEFAULT_VALUE DEFAULT_VALUE
<BLANKLINE> <BLANKLINE>
With --verbose::
>>> print_(system(os.path.join('bin', 'buildout') + ' annotate --verbose'), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
...
[part1]
option= a1 a2
a3 a4
a5
<BLANKLINE>
IN extension2.cfg
ADD VALUE = a5
IN extension1.cfg
ADD VALUE = a3 a4
IN base.cfg
SET VALUE = a1 a2
<BLANKLINE>
...
[part2]
option= b1 b2 b3 b4
<BLANKLINE>
IN extension2.cfg
REMOVE VALUE = b1 b2 b3
IN extension1.cfg
REMOVE VALUE = b1 b2
IN base.cfg
SET VALUE = b1 b2 b3 b4
<BLANKLINE>
...
[part3]
option=
c1 c2
c3 c4 c5
<BLANKLINE>
IN extension1.cfg
ADD VALUE = c3 c4 c5
IN base.cfg
SET VALUE = c1 c2
<BLANKLINE>
...
[part4]
option=
d2
d3
d1
d4
<BLANKLINE>
IN extension1.cfg
REMOVE VALUE = d5
IN extension1.cfg
ADD VALUE =
d1
d4
IN base.cfg
SET VALUE =
d2
d3
d5
<BLANKLINE>
...
[part5]
option= h1 h2
<BLANKLINE>
IN extension1.cfg
SET VALUE = h1 h2
<BLANKLINE>
...
Cleanup:: Cleanup::
>>> os.remove(os.path.join(sample_buildout, 'base.cfg')) >>> os.remove(os.path.join(sample_buildout, 'base.cfg'))
......
...@@ -3539,7 +3539,7 @@ def test_suite(): ...@@ -3539,7 +3539,7 @@ def test_suite():
(re.compile('setuptools'), 'setuptools'), (re.compile('setuptools'), 'setuptools'),
(re.compile('Got zc.recipe.egg \S+'), 'Got zc.recipe.egg'), (re.compile('Got zc.recipe.egg \S+'), 'Got zc.recipe.egg'),
(re.compile(r'zc\.(buildout|recipe\.egg)\s*= >=\S+'), (re.compile(r'zc\.(buildout|recipe\.egg)\s*= >=\S+'),
'zc.\1 = >=1.99'), 'zc.\\1 = >=1.99'),
]) ])
) + manuel.capture.Manuel(), ) + manuel.capture.Manuel(),
'buildout.txt', 'buildout.txt',
......
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