开发者

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

开发者 https://www.devze.com 2023-02-12 15:45 出处:网络
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 comm

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 th开发者_StackOverflow社区e 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 ;)


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号