【问题标题】:Merging shelved changlist into branch将搁置的变更列表合并到分支中
【发布时间】:2017-11-24 19:08:02
【问题描述】:

我的一位同事有一个搁置的更改列表 (CL#12345),其中包括编辑和新(添加)文件。这些文件都存在于:

//software/my_luggage/main/...

我想unshelve这些更改,并将它们应用到位于的分支:

//software/my_luggage/beta/...

我尝试通过以下方式生成并手动应用补丁:

p4 describe -S 12345 > ~/tmp.patch

但是,这有两个问题:

  1. 补丁需要转换成通用的 Unix diff 格式,类似于p4 diff -du 的输出(我有一个脚本)。
  2. p4 describe 操作的输出不包含新/添加文件中的内容。

是否有一种简单的方法来p4 unshelve 搁置的更改列表并修改将“应用”搁架的目标,还是我必须手动复制和重新添加文件、手动修补单个文件等? 如果可能的话,我更喜欢通过命令行而不是P4V GUI 来完成

【问题讨论】:

    标签: linux version-control perforce perforce-integrate perforce-branch-spec


    【解决方案1】:

    制作一个分支规范:

    Branch: luggage_beta
    View:
        //software/my_luggage/main/... //software/my_luggage/beta/...
    

    运行:

    p4 unshelve -b luggage_beta -s 12345
    p4 resolve
    

    您将需要 2013.1 或更高版本的 Perforce 服务器:

    Major new functionality in 2013.1
    
        #538913 (Bug #36686) **
            Shelved changes may now be unshelved into different branches
            or related streams via 'p4 unshelve -b' and 'p4 unshelve -S'.  
            See 'p4 help unshelve'.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 2015-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-24
      相关资源
      最近更新 更多