File: test_04_pre_commit_test_1.py

package info (click to toggle)
pysvn 1.5.0dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,524 kB
  • ctags: 2,281
  • sloc: cpp: 9,846; python: 2,662; sh: 430; makefile: 101; ansic: 9
file content (27 lines) | stat: -rw-r--r-- 860 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import sys
import pysvn
print 'Info: pre commit test 1'

print 'Info: Transaction( %s, %s) ...' % (sys.argv[1], sys.argv[2])
t = pysvn.Transaction( sys.argv[1], sys.argv[2] )

print 'Info: revproplist() ...'
all_props = t.revproplist()
for name, value in all_props.items():
    print '%s: %s' % (name, value)

print 'Info: changed() ...'
changes = t.changed()
change_list = changes.items()
change_list.sort()
for name, (action, kind, text_mod, prop_mod) in change_list:
    print '%s: action=%r, kind=%r, text_mod=%r, prop_mod=%r' % (name, action, kind, text_mod, prop_mod)
    if action != 'D':
        all_props = t.proplist( name )
        for prop_name, prop_value in all_props.items():
            print '     %s: %s' % (prop_name, prop_value)
        if kind == pysvn.node_kind.file:
            print '     contents: %r' % t.cat( name )


sys.exit( 0 )