3 from bup import options, git, vfs
4 from bup.helpers import *
6 def print_node(text, n):
9 prefix += "%s " % n.hash.encode('hex')
10 if stat.S_ISDIR(n.mode):
11 print '%s%s/' % (prefix, text)
12 elif stat.S_ISLNK(n.mode):
13 print '%s%s@' % (prefix, text)
15 print '%s%s' % (prefix, text)
21 s,hash show hash for each file
22 a,all show hidden files
24 o = options.Options(optspec)
25 (opt, flags, extra) = o.parse(sys.argv[1:])
27 git.check_repo_or_die()
28 top = vfs.RefList(None)
37 if stat.S_ISDIR(n.mode):
39 if opt.all or not sub.name.startswith('.'):
40 print_node(sub.name, sub)
42 if opt.all or not sub.name.startswith('.'):
44 except vfs.NodeError, e:
45 log('error: %s\n' % e)