minirst: support containers
Text can be grouped into generic containers in reStructuredText:
.. container:: foo
This is text inside a "foo" container.
.. container:: bar
This is nested inside two containers.
The minirst parser now recognizes these containers. The containers are
either pruned completely from the output (included all nested blocks)
or they are simply un-indented. So if 'foo' and 'bar' containers are
kept, the above example will result in:
This is text inside a "foo" container.
This is nested inside two containers.
If only 'foo' containers are kept, we get:
This is text inside a "foo" container.
No output is made if only 'bar' containers are kept.
This feature will come in handy for implementing different levels of
help output (e.g., verbose and debug level help texts).
#!/bin/sh
echo % bundle w/o type option
hg init t1
hg init t2
cd t1
echo blablablablabla > file.txt
hg ci -Ama
hg log | grep summary
hg bundle ../b1 ../t2
cd ../t2
hg pull ../b1
hg up
hg log | grep summary
cd ..
for t in "None" "bzip2" "gzip"; do
echo % test bundle type $t
hg init t$t
cd t1
hg bundle -t $t ../b$t ../t$t
cut -b 1-6 ../b$t | head -n 1
cd ../t$t
hg pull ../b$t
hg up
hg log | grep summary
cd ..
done
echo % test garbage file
echo garbage > bgarbage
hg init tgarbage
cd tgarbage
hg pull ../bgarbage
cd ..
echo % test invalid bundle type
cd t1
hg bundle -a -t garbage ../bgarbage
cd ..