Perforce connect history of two different files

I have a problem, in an attempt to refactor I copied files from one place to another and added them to my scm (perforce). When I finished and everything worked, I deleted the old (moved) files.

Can I relate file histories to each other? It would be best to "move" as it should have been done.

Thanks for the help!

+3
source share
1 answer

Suppose your source file //source/old/file.c#5and you moved it to //source/new/file.c, and then deleted the old file in the edition //source/old/file.c#6. You need to integrate from the old file into the new file using the flag -iso that Perforce allows you to integrate two files that it does not know the integration history:

p4 integrate -i //source/old/file.c#5 //source/new/file.c

then allow the files. Usually during integration you want to accept the merged version of the file, but in this case you are mainly interested in letting Perforce know that you have already done the integration, so you can use it -ayto “accept yours” by discarding the old version of the file:

p4 resolve -ay //source/new/file.c

then submit the revision.

(Ideally, you would integrate first, then make any changes and present everything, but in this way the files will be linked in the Perforce integration history.)

+8

Source: https://habr.com/ru/post/1750049/


All Articles