当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这是带有--回溯的输出:
C:\workspaces\test_next>hg --traceback commit -m "test"
Exception AttributeError: "'PPReleaseProject' object has no attribute '_projectname'" in <bound method PPReleaseProject.
__del__ of <testtrack.interface.PPReleaseProject object at 0x01C065F0>> ignored
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 54, in _runcatch
File "mercurial\dispatch.pyo", line 494, in _dispatch
File "mercurial\dispatch.pyo", line 355, in runcommand
File "mercurial\dispatch.pyo", line 545, in _runcommand
File "mercurial\dispatch.pyo", line 499, in checkargs
File "mercurial\dispatch.pyo", line 492, in <lambda>
File "mercurial\util.pyo", line 420, in check
File "mercurial\commands.pyo", line 769, in commit
File "mercurial\cmdutil.pyo", line 1209, in commit
File "mercurial\commands.pyo", line 764, in commitfunc
File "mercurial\localrepo.pyo", line 892, in commit
File "mercurial\localrepo.pyo", line 153, in hook
File "mercurial\hook.pyo", line 142, in hook
File "mercurial\hook.pyo", line 84, in _pythonhook
Abort: precommit.fix_in_progress hook failed
abort: precommit.fix_in_progress hook failed--调试输出:
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发布于 2010-11-08 08:59:54
修改钩子脚本以捕获异常(将其封装在try...except块中),并在except子句中使用traceback模块格式化完整的跟踪并将其写入stderr/stdout?
https://stackoverflow.com/questions/4122392
复制相似问题