【问题标题】:how can I get a CL number just generated in P4?如何获得刚刚在 P4 中生成的 CL 编号?
【发布时间】:2021-12-27 18:21:24
【问题描述】:

我对 P4 很陌生,作为一名初级开发人员,我在尝试从流中自动合并时遇到了一些问题,我运行 p4 merge,然后运行 ​​p4 resolve -am,然后我构建项目并运行一些测试和如果一切顺利,我想提交否则搁置文件,以便工程师可以解决冲突,手动解决它们并提交。问题是,据我所知,p4 shelve 命令需要有 -c <CL#> 参数,而且我不知道如何或在哪里可以获得我在运行脚本时刚刚生成的 CL 编号。有没有办法做到这一点?或任何可以帮助我的文档?

【问题讨论】:

    标签: version-control perforce


    【解决方案1】:

    shelve 命令不需要-c 参数。

    C:\Perforce\test\python>p4 help shelve
    
        shelve -- Store files from a pending changelist into the depot
    
        p4 shelve [-Af] [-p] [files]
        p4 shelve [-Af] [-a option] [-p] -i [-f | -r]
        p4 shelve [-Af] [-a option] [-p] -r -c changelist#
        p4 shelve [-Af] [-a option] [-p] -c changelist# [-f] [file ...]
        p4 shelve [-As] -d -c changelist# [-f] [file ...]
    
            ...
    
            By default, 'p4 shelve' creates a changelist, adds files from the
            user's default changelist, then shelves those files in the depot.
    

    如果您刚刚运行 p4 mergep4 resolve -am,则这些文件将在您的默认更改列表中打开。在不带参数的情况下运行p4 shelve 会自动从这些文件中创建一个新的更改列表并将其搁置,它会显示新更改列表的编号,因此您的脚本需要做的就是打印命令的结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-18
      • 1970-01-01
      • 1970-01-01
      • 2011-03-06
      • 2010-11-15
      • 2012-12-19
      • 2013-10-14
      相关资源
      最近更新 更多