尝试使用 code_swarm 但我在 osx 上的 perforce 上遇到一些 python 脚本问题
我运行此程序时遇到问题:
link-mbp:codeswarm-0.1 benb$ python convert_logs/convert_logs.py -perforce-path
Traceback (most recent call last):
File “convert_logs/convert_logs.py”, line 408, in
main()
File “convert_logs/convert_logs.py”, line 350, in main
files = run_marshal(’p4 -G describe -s “‘ + changelist['change'] + ‘”‘)
KeyError: ‘change’
link-mbp:codeswarm-0.1 benb$
我正在尝试从此链接使用 code_swarm http://blog.perforce.com/blog/?p=780&cpage=1#comment-965 以可视化我的代码库更改。
如果我运行 p4 更改,一切都显示正确,但此 python 脚本中的代码似乎无法正确处理...
如果我在更改列表编号上运行 p4 描述,它会正确报告
想法吗?
I am having issues running this:
link-mbp:codeswarm-0.1 benb$ python convert_logs/convert_logs.py -perforce-path
Traceback (most recent call last):
File “convert_logs/convert_logs.py”, line 408, in
main()
File “convert_logs/convert_logs.py”, line 350, in main
files = run_marshal(’p4 -G describe -s “‘ + changelist['change'] + ‘”‘)
KeyError: ‘change’
link-mbp:codeswarm-0.1 benb$
I am trying to use code_swarm from this link http://blog.perforce.com/blog/?p=780&cpage=1#comment-965 to visualize my codebase changes.
if I run p4 changes everything shows correct but the code in this python script doesnt seem to process correctly...
if I run p4 describe on a a changelist number it correctly reports
ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了完全相同的问题。由于不是 python 专家,我使用第 350 行的打印语句调试了脚本,如下所示:
这揭示了我的问题 - 我使用了像
p4='p4 -C utf8'
这样的别名来传递字符集迫不得已。因此,当我从命令行运行它时,别名已被处理,并且describe
命令就像一个超级按钮一样工作,但是当从 python 调用时,别名未被处理。我只是通过在 python 脚本中的两个位置将'p4'
替换为'p4 -C utf8'
来破解脚本。您的问题可能相同或不同,但希望这将帮助您快速调试它!
I had the exact same problem. Not being an expert on python I debugged the script using a print-statement on line 350 like this:
This revealed my problem - I had used an alias like
p4='p4 -C utf8'
to pass charset to perforce. So when I run it from the command line the alias was processed and thedescribe
command worked like a charm, but when invoked from python the alias was not processed. I just hacked the script by replacing'p4'
with'p4 -C utf8'
in the two places in the python script.You problem might be the same or a diffrent one, but hopefully this will help you debugg it quickly!