Can I integrate checked out files into a different branch on perforce

后端 未结 6 1735
无人共我
无人共我 2021-01-04 19:26

We were working on a design, and for that we created the skeleton of the classes in our main branch. Now, we are starting to code, and for that we got a new branch. So, it

6条回答
  •  猫巷女王i
    2021-01-04 20:04

    Since release 2013.1, the way to branch work in progress is to shelve the work and unshelve it on the branch. In detail:

    1. Shelve your outstanding changes:

      $ p4 shelve ...
      Change 182535 created with 10 open file(s).
      Shelving files for change 182535.
      edit //info.ravenbrook.com/project/mps/master/code/arenavm.c#26
      # etc.
      
    2. Unshelve them on the branch (using the -b option, which maps the file name through a branch specification):

      $ p4 unshelve -b mps/branch/2013-06-05/diag -s 182535
      ... //info.ravenbrook.com/project/mps/branch/2013-06-05/diag/code/arenavm.c - must resolve //info.ravenbrook.com/project/mps/master/code/arenavm.c@=182535 before submitting
      # etc.
      
    3. Resolve any merges resulting from the unshelve, using p4 resolve -as to quickly do the "safe" ones, and then doing the rest with p4 resolve as usual.

      $ p4 resolve -as
      //gdr-peewit/info.ravenbrook.com/project/mps/branch/2013-06-05/diag/code/arenavm.c - copy from //info.ravenbrook.com/project/mps/master/code/arenavm.c
      # etc.
      $ p4 resolve
      No file(s) to resolve.
      

    (The example output is from a real use case I ran just now.)

提交回复
热议问题