3
# revplist.py : display revision properties
5
######################################################################
7
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
9
# This software is licensed as described in the file COPYING, which
10
# you should have received as part of this distribution. The terms
11
# are also available at http://subversion.tigris.org/license-1.html.
12
# If newer versions of this license are posted there, you may use a
13
# newer version instead, at your option.
15
######################################################################
22
from svn import fs, core
24
def plist(pool, rev=None, home='.', *props):
26
db_path = os.path.join(home, 'db')
27
if not os.path.exists(db_path):
30
fs_ptr = fs.new(None, pool)
31
fs.open_berkeley(fs_ptr, db_path)
34
rev = fs.youngest_rev(fs_ptr, pool)
36
print 'Properties for revision:', rev
38
for propname in props:
39
value = fs.revision_prop(fs_ptr, rev, propname, pool)
41
print '%s: <not present>' % propname
43
print '%s: %s' % (propname, value)
45
proplist = fs.revision_proplist(fs_ptr, rev, pool)
46
for propname, value in proplist.items():
47
print '%s: %s' % (propname, value)
50
print "USAGE: %s [-r REV] [-h DBHOME] [PROP1 [PROP2 ...]]" % sys.argv[0]
54
### how to invoke usage() ?
55
opts, args = getopt.getopt(sys.argv[1:], 'r:h:')
58
for name, value in opts:
64
apply(core.run_app, (plist, rev, home) + tuple(args))
66
if __name__ == '__main__':