我一直在尝试使用 git-p4 python 脚本将 p4 仓库路径导入 git。配置我的环境(git 1.7.1、python 2.7、Windwos XP、p4 env 变量)后,我尝试运行 git-p4 脚本,得到以下输出:
F:\gitp4>c:\Python27\python.exe git-p4.py clone --destination=master //depot/quake/main/...@all
Reading pipe: git config git-p4.syncFromOrigin
Importing from //depot/quake/main/...@all into master
Initialized empty Git repository in F:/gitp4/master/.git/
Traceback (most recent call last):
File "git-p4.py", line 1926, in <module>
main()
File "git-p4.py", line 1921, in main
if not cmd.run(args):
File "git-p4.py", line 1798, in run
if not P4Sync.run(self, depotPaths):
File "git-p4.py", line 1501, in run
self.hasOrigin = originP4BranchesExist()
File "git-p4.py", line 439, in originP4BranchesExist
return gitBranchExists("origin") or gitBranchExists("origin/p4") or gitBranchExists("origin/p4/master")
File "git-p4.py", line 332, in gitBranchExists
stderr=subprocess.PIPE, stdout=subprocess.PIPE);
File "c:\Python27\lib\subprocess.py", line 672, in __init__
errread, errwrite)
File "c:\Python27\lib\subprocess.py", line 882, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
有人知道这里发生了什么吗?如果我尝试从命令行 shell 运行第 332 行声明的 git 命令(git rev-parse origin),则该命令将正确执行。
谢谢。
更新:似乎脚本无法启动其 exec 文件不在执行路径中的任何进程。我认为这是Windows上python的初始化问题...