Suppose your original file is //source/old/file.c#5
and you moved it to //source/new/file.c
, then deleted the old file in revision //source/old/file.c#6
. You need to integrate from the old file to the new file, using the -i
flag so Perforce will allow you to integrate between two files that it doesn't otherwise know of an integration history:
p4 integrate -i //source/old/file.c#5 //source/new/file.c
then resolve the files. Normally while integrating you'll want to accept a merged version of the file, but in this case you're mostly interested in letting Perforce know you already did the integration, so you can use -ay
to "accept yours", discarding the old version of the file:
p4 resolve -ay //source/new/file.c
then submit the revision.
(Ideally you would have integrated first, then made any changes, and submitted everything, but this way the files will be linked in Perforce's integration history.)