# HG changeset patch # User Matt Mackall # Date 1313120441 18000 # Node ID 3f4d337cb80aa80fbfddee6d9e76a260d1edbf36 # Parent df47381b41d67927c089825ff4af17423e569cfd minirst: drop debug code This standalone mode no longer works due to the mechanics of import and util. When run not as part of a package, the import of util causes an import of the built-in posix module, which doesn't contain the expected symbols. This is difficult to fix in Py2.4. diff -r df47381b41d6 -r 3f4d337cb80a mercurial/minirst.py --- a/mercurial/minirst.py Thu Aug 11 22:05:57 2011 -0500 +++ b/mercurial/minirst.py Thu Aug 11 22:40:41 2011 -0500 @@ -18,7 +18,7 @@ when adding support for new constructs. """ -import re, sys +import re import util, encoding from i18n import _ @@ -553,27 +553,3 @@ text = formatblocks(s[2], width) lines.append([(section, l) for l in text.splitlines(True)]) return lines - -if __name__ == "__main__": - from pprint import pprint - - def debug(func, *args): - blocks = func(*args) - print "*** after %s:" % func.__name__ - pprint(blocks) - print - return blocks - - text = sys.stdin.read() - blocks = debug(findblocks, text) - blocks = debug(findliteralblocks, blocks) - blocks, pruned = debug(prunecontainers, blocks, sys.argv[1:]) - blocks = debug(inlineliterals, blocks) - blocks = debug(splitparagraphs, blocks) - blocks = debug(updatefieldlists, blocks) - blocks = debug(updateoptionlists, blocks) - blocks = debug(findsections, blocks) - blocks = debug(addmargins, blocks) - blocks = debug(prunecomments, blocks) - blocks = debug(findadmonitions, blocks) - print '\n'.join(formatblock(b, 30) for b in blocks)