On Monday 08 March 2010 11:59:28 am Роман Донченко wrote: > Alexey Neyman <[email protected]> писал в своём письме Mon, 08 Mar 2010 > > 20:29:41 +0300: > > Any experts on Python bindings on this list? :) > > > > Could this at least be confirmed to be a bug, so that I could enter > > it into issues database? > > Um, I'm standing right here. 8=] > > http://permalink.gmane.org/gmane.comp.version-control.subversion.devel/ >118547
Sorry, I somehow missed your reply.
Please find a test script attached. It should abort the commit (so that
stderr from pre-commit script is seen) and dump the 'ops' list contents.
Instead, it produces a traceback:
======================================
Transmitting file data .svn: Commit failed (details follow):
svn: Commit blocked by pre-commit hook (exit code 1) with output:
@DEBUG@ open_file foo
@DEBUG@ apply_textdelta to foo
@DEBUG@ txdelta received on foo src[0,1333] tgt[X,1391] src_ops 2 num_ops
4
@DEBUG@ new_data 'medextra new line
'
Traceback (most recent call last):
File "/tmp/test-repo/hooks/pre-commit", line 62, in <module>
core.run_app(verify, sys.argv[1], sys.argv[2])
File "/usr/local/lib/svn-python/svn/core.py", line 281, in run_app
return func(application_pool, *args, **kw)
File "/tmp/test-repo/hooks/pre-commit", line 56, in verify
repos.svn_repos_replay2(txn_root, "", -1, True, e_ptr, e_baton, None,
pool)
File "/usr/local/lib/svn-python/libsvn/repos.py", line 311, in
svn_repos_replay2
return apply(_repos.svn_repos_replay2, args)
File "/tmp/test-repo/hooks/pre-commit", line 45, in txdelta_handler
for op in window.ops:
TypeError: iteration over non-sequence
====================================
As a side note, I think that 'num_ops' and 'src_ops' should be
declared %immutable and only changed via assignment to 'ops'.
Perhaps, 'ops' should also be made read-only, as it doesn't make much
sense to allow assignments to 'ops' while having 'new_data' as read-only
('ops' refer to certain parts in 'new_data', and 'new_data' is currently
declared %immutable).
Regards,
Alexey.
test.sh
Description: application/shellscript

