git p4 depot-path错误

时间:2012-09-11 10:05:46

标签: git perforce git-p4

使用git-p4在perforce上设置git时遇到问题。 完成这篇优秀博客文章http://owenou.com/2011/03/23/git-up-perforce-with-git-p4.html的所有步骤后,我尝试在本地git存储库中添加新文件/修改现有文件。

当我试图改变时,我得到:

$git-p4 rebase  
Traceback (most recent call last):  
  File "/home/user/bin/git-p4", line 2362, in <module>  
    main()  
  File "/home/user/bin/git-p4", line 2357, in main  
    if not cmd.run(args):  
  File "/home/user/bin/git-p4", line 2051, in run  
    sync.run([])  
  File "/home/user/bin/git-p4", line 2004, in run  
    changes = self.p4.p4ChangesForPaths(self.depotPaths, self.changeRange)  
  File "/home/user/bin/git-p4", line 232, in p4ChangesForPaths  
    assert depotPaths  
AssertionError  

将更改提交给git并执行
git p4 submit --verbose
应该将更改推送到p4存储库,我得到65534行输出:

Reading pipe: git notes --ref=git-p4 show HEAD~1  
Reading pipe: git notes --ref=git-p4 show HEAD~2  
[...]  
Reading pipe: git notes --ref=git-p4 show HEAD~65534  
Traceback (most recent call last):  
  File "/home/wgorski/opt/git-p4/git-p4", line 2754, in <module>  
    main()  
  File "/home/wgorski/opt/git-p4/git-p4", line 2749, in main  
    if not cmd.run(args):  
  File "/home/wgorski/opt/git-p4/git-p4", line 1125, in run  
    self.depotPath = settings['depot-paths'][0]  
KeyError: 'depot-paths'  

毋庸置疑,这些更改不会被推送到p4存储库。

1 个答案:

答案 0 :(得分:3)

问题是git版本。我安装了git 1.7.0,git-p4脚本需要git版本&gt; = 1.7.1。 我建议更新到最新的git版本。

如果无法升级git,您可以将git-p4脚本降级为不使用备注的修订版,如下所示:

git checkout 994ec6ce71cb03786a27a77da77ac33a9e53e090 .

降级git-p4后,你需要查看perforce的本地git repo。