Perforce to Git:无效选项:-r [英] Perforce to Git: Invalid option: -r

查看:547
本文介绍了Perforce to Git:无效选项:-r的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将一个项目从Perforce迁移到Git中。我使用 git-p4 作为我的主要工具来完成繁重的工作,并且它在Windows上默认使用Git:

I am trying to migrate a project from Perforce into Git. I am using git-p4 as my main tool to do the heavy lifting for me, and it comes by default with Git on Windows:

C:\ Program Files \Git\mingw64\libexec\git-core\git-p4

将Perforce迁移到Windows中的Git ,我已经完成了执行克隆命令的步骤: git p4 clone< PerforceRepo> (其中p4是文件git-p4.py的别名)

Following Migrating Perforce to Git in Windows, I have reached the step where I execute my cloning command: git p4 clone <PerforceRepo> (where p4 is an alias for the file git-p4.py)

我一直收到错误:

I keep getting error:


无效的选项:-r。

Invalid option: -r.



C:\P4-To-Git>git p4 clone //depot/C:\build\mainline@all .
Importing from //depot/C:/build/mainline@all into .
Reinitialized existing Git repository in C:/P4-To-Git/.git/
Perforce client error:
        p4 -h for usage.
        Invalid option: -r.
Traceback (most recent call last):
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3840, in <module>
    main()
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3834, in main
    if not cmd.run(args):
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3706, in run
    if not P4Sync.run(self, depotPaths):
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3546, in run
    changes = p4ChangesForPaths(self.depotPaths, self.changeRange, self.changes_block_size)
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 852, in p4ChangesForPaths
    changeEnd = p4_last_change()
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 317, in p4_last_change
    return int(results[0]['change'])
KeyError: 'change'

我已经看过p4-git python文件,并且没有地方其中正在使用 -r 。任何帮助?

I have looked into p4-git python file and there is no place where -r is being used. Any help?

推荐答案

尝试将 git-p4.retries 设置为0 ?

if retries > 0:
    # Provide a way to not pass this option by setting git-p4.retries to 0
    real_cmd += ["-r", str(retries)]

或者升级您的 p4 可执行文件,以支持 -

Or upgrade your p4 executable so it supports the -r global flag -- this option was added in the 2012.2 release:

Minor new functionality in 2012.2

    #384638 *** ** *
        The net.maxwait configurable can be used to specify a hard limit
        (in seconds) on the maximum time that a connection will wait for
        any single network send or receive to complete. The 'p4 sync'
        command now supports a '-r' global flag to specify that the sync
        command should be retried if a network error occurs.

这篇关于Perforce to Git:无效选项:-r的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆