git-p4: 没有这个文件或目录。

4

我正在尝试在Linux上使用git-p4,并将git-p4.py添加到我的.gitconfig中。然而,在克隆时,我遇到了这个错误:

math@math:/mnt/d$ git p4 clone //depot/path/main@all
Importing from //depot/path/main@all into main
Reinitialized existing Git repository in /mnt/d/main/.git/
Traceback (most recent call last):
  File "/home/math/bin/git-p4.py", line 3703, in <module>
    main()
  File "/home/math/bin/git-p4.py", line 3697, in main
    if not cmd.run(args):
  File "/home/math/bin/git-p4.py", line 3571, in run
    if not P4Sync.run(self, depotPaths):
  File "/home/math/bin/git-p4.py", line 3411, in run
    changes = p4ChangesForPaths(self.depotPaths, self.changeRange, self.changes_block_size)
  File "/home/math/bin/git-p4.py", line 807, in p4ChangesForPaths
    changeEnd = p4_last_change()
  File "/home/math/bin/git-p4.py", line 266, in p4_last_change
    results = p4CmdList(["changes", "-m", "1"])
  File "/home/math/bin/git-p4.py", line 492, in p4CmdList
    stdout=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

目录或文件应该存在吗?我已经设置了以下环境变量:P4HOST、P4PASSWD、P4PORT和P4USER。


4
也许p4可执行文件不在您的PATH中?看起来git-p4.py正试图运行p4 changes -m 1命令,但显示"没有那个文件或目录"。 - Bryan Pendleton
1个回答

4

我现在遇到了同样的问题。是的,@BryanPendleton是正确的:你只需要将p4添加到$PATH中即可。


确认。我的经验也是一样的;将p4二进制文件添加到我的路径中使魔法流畅运行。 - James T Snell

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接