Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 有没有办法让Mercurial给我一个更详细的错误消息?_Python_Mercurial - Fatal编程技术网

Python 有没有办法让Mercurial给我一个更详细的错误消息?

Python 有没有办法让Mercurial给我一个更详细的错误消息?,python,mercurial,Python,Mercurial,当Mercurial进程在本地运行时,我的钩子在远程服务器上运行时遇到问题。错误消息的信息不是很丰富,但我很确定这是Python路径问题。我在尝试提交变更集时出错 是否仍然可以获得完整的堆栈跟踪?以下输出都不如堆栈跟踪有用 这是常见的错误消息: C:\workspaces\test_next>hg commit -m "test" Exception AttributeError: "'PPReleaseProject' object has no attribute '_projectn

当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:\workspace\test\u next>hg commit-m“test”
异常AttributeError:“'PPReleaseProject'对象在已忽略中没有属性'\u projectname'”
中止:precommit.fix\u in\u进程挂钩失败
这是带有--traceback的输出:

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:\workspace\test\u next>hg--回溯提交-m“test”
异常AttributeError:“'PPReleaseProject'对象在已忽略中没有属性'\u projectname'”
回溯(最近一次呼叫最后一次):
文件“mercurial\dispatch.pyo”,第54行,在runcatch中
文件“mercurial\dispatch.pyo”,第494行,在\u dispatch中
runcommand中第355行的文件“mercurial\dispatch.pyo”
文件“mercurial\dispatch.pyo”,第545行,在运行命令中
checkargs中第499行的文件“mercurial\dispatch.pyo”
文件“mercurial\dispatch.pyo”,第492行,在
检查文件“mercurial\util.pyo”,第420行
提交中第769行的文件“mercurial\commands.pyo”
提交中第1209行的文件“mercurial\cmdutil.pyo”
commitfunc中第764行的文件“mercurial\commands.pyo”
提交中第892行的文件“mercurial\localrepo.pyo”
文件“mercurial\localrepo.pyo”,第153行,在hook中
文件“mercurial\hook.pyo”,第142行,在hook中
pythonhook中第84行的文件“mercurial\hook.pyo”
中止:precommit.fix\u in\u进程挂钩失败
中止:precommit.fix\u in\u进程挂钩失败
带有--debug的输出:

C:\workspace\test\u next>hg--debug commit-m“test”
调用钩子预提交分支检查:
调用hook precommit.debug\u code\u check:
正在调用hook precommit.fix\u:
异常AttributeError:“'PPReleaseProject'对象在已忽略中没有属性'\u projectname'”
中止:precommit.fix\u in\u进程挂钩失败

修改钩子脚本以捕获异常(将其包装在
try…except
块中),并在
except
子句中,使用
traceback
模块格式化完整长度的回溯,并将其写入stderr/stdout?

修改钩子脚本以捕获异常(将其包装在
try…except
块中)在
except
子句中,使用
traceback
模块格式化一个完整长度的回溯,并将其写到stderr/stdout?

你一路抓住了我,直到这段时间上面出现了一个无关的扭曲?很好的建议!谢谢。:-)你一路上都在缠着我,直到这段时间出现了一个不相干的扭曲?好建议!谢谢。:-)
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