【问题标题】:how to sync the perforce client only with the files of a particular change list using p4 sync command如何使用 p4 sync 命令仅将 perforce 客户端与特定更改列表的文件同步
【发布时间】:2015-03-09 11:09:32
【问题描述】:

我正在尝试仅将特定更改列表中修改的文件同步到 p4v。

假设在 perforce 目录 //demo/test 我有 10 个文件,其中只有 3 个被修改为更改列表 number 1234 的一部分。我只想同步 3 个文件。我尝试了以下选项,但没有成功。

p4 sync //demo/test...@1234;

此命令表示文件已更新,但我没有看到文件同步。

p4 sync -f //demo/test...@1234;

此命令正在同步目录中的所有 10 个文件。

【问题讨论】:

    标签: perforce


    【解决方案1】:

    使用

    p4 sync //demo/test...@1234,1234
    

    p4 sync //demo/test...@=1234
    

    在运行此类测试时,请记住“p4 sync”不会同步您已经拥有的文件,这就是为什么您发现需要运行“p4 sync -f”来强制发送文件,即使服务器知道您已经拥有它们。如果你想清除你拥有的文件的服务器内存,你可以运行

    p4 sync //demo/test...#none
    

    这将从您的工作区中删除与“//demo/test...”匹配的所有(p4 管理的)文件,然后“p4 同步”将在下次将它们带回来。

    哦,既然 'test' 是一个目录,那么模式

    //demo/test/...
    

    优于

    //demo/test...
    

    因为 '//demo/test/...' 只匹配 test 目录中的文件,而 '//demo/test...' 也会匹配 '//demo/test1' 中的文件, '//demo/test-and-set' 和 '//demo/testarossa' 目录(如果它们碰巧存在的话)。

    【讨论】:

    • 谢谢 Bryan,我在清除缓存后运行了以下命令,它工作了.. p4 sync //demo/test...@=1234
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-02
    相关资源
    最近更新 更多