1
#! /usr/bin/env python2.4
3
3
# Copyright (C) 2005 Canonical Ltd
5
"""Print to stdout a description of the current directory,
5
"""Print to stdout a description of the current directory,
6
6
formatted as a Python data structure.
8
8
This can be useful in tests that need to recreate directory
11
from __future__ import print_function
16
from breezy.trace import enable_default_logging
14
from bzrlib.trace import enable_default_logging
17
15
enable_default_logging()
18
from breezy.selftest.treeshape import capture_tree_contents
16
from bzrlib.selftest.treeshape import capture_tree_contents
21
19
# a lame reimplementation of pformat that splits multi-line
22
20
# strings into concatenated string literals.
24
22
for tt in capture_tree_contents('.'):
25
23
assert isinstance(tt, tuple)
26
print(' (', repr(tt[0]) + ',', end=' ')
24
print ' (', repr(tt[0]) + ',',
30
28
assert len(tt) == 2
36
34
for valline in val.splitlines(True):
37
print(' ', repr(valline))
35
print ' ', repr(valline)
41
39
if __name__ == '__main__':
42
40
sys.exit(main(sys.argv))