当Mercurial进程在本地运行时,我的钩子在远程服务器上运行时遇到问题。错误消息的信息不是很丰富,但我确信这是Python路径问题。当我试图提交变更集时,我得到了错误。在
是否有办法获得完整的堆栈跟踪?以下输出都不如堆栈跟踪有用。在
以下是常规错误消息:
C:\workspaces\test_next>hg commit -m "test"
Exception AttributeError: "'PPReleaseProject' object has no attribute '_projectname'" in <bound method PPReleaseProject.
__del__ of <testtrack.interface.PPReleaseProject object at 0x01BE35F0>> ignored
abort: precommit.fix_in_progress hook failed
这是带有--traceback的输出:
^{pr2}$带有--debug的输出:
C:\workspaces\test_next>hg --debug commit -m "test"
calling hook precommit.branch_check: <function precommit_bad_branch at 0x01C585F0>
calling hook precommit.debug_code_check: <function precommit_contains_debug_code at 0x01C4A830>
calling hook precommit.fix_in_progress: <function precommit_fix_in_progress at 0x01C09270>
Exception AttributeError: "'PPReleaseProject' object has no attribute '_projectname'" in <bound method PPReleaseProject.
__del__ of <testtrack.interface.PPReleaseProject object at 0x01C5D5D0>> ignored
abort: precommit.fix_in_progress hook failed
修改钩子脚本以捕获异常(将其包装在
try...except
块中),并在except
子句中,使用traceback
模块格式化一个完整的回溯并将其写出stderr/stdout?在相关问题 更多 >
编程相关推荐