How do you step through a Subversion hook script with pdb?

215 views Asked by At

I've Googled for this far & wide and turned up nothing. I've written a pre-commit hook for Subversion in Python. If I insert pdb.setTrace() into my hook script and call it manually from the command-line, I can step through it as normal. However, if I do a commit & allow Subversion to call the script, the call to setTrace() causes the script to print some traceback information to the console & die, instead of what I want, which is to step through the script with a debugger.

Is there any solution for this? I can get the script working by just calling it manually, but I would really like to be able to step through it and examine it in detail when it's being used for real.

I imagine there is an analogous problem with debugging CGI scripts?

PS: I'm doing all this on a dummy test repository, not on the real thing. I may be dumb, but I ain't stupid ;)

1

There are 1 answers

0
AudioBubble On

Something like a "remote pdb" might be useful here:

http://snippets.dzone.com/posts/show/7248