尝试使用 code_swarm 但我在 osx 上的 perforce 上遇到一些 python 脚本问题

发布于 2024-08-27 02:57:24 字数 702 浏览 3 评论 0原文

我运行此程序时遇到问题:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝情姑娘 2024-09-03 02:57:24

我遇到了完全相同的问题。由于不是 python 专家,我使用第 350 行的打印语句调试了脚本,如下所示:

for changelist in changelists:
    print changelist # <-- here
    files = run_marshal('p4 -G describe -s "' + changelist['change'] + '"')

这揭示了我的问题 - 我使用了像 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:

for changelist in changelists:
    print changelist # <-- here
    files = run_marshal('p4 -G describe -s "' + changelist['change'] + '"')

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 the describe 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文