views:

38

answers:

1

Hi everyone!

I have a problem, in a refactoring attempt I have copied files from one place to another and added them in my scm (perforce). When I was done and everything was working I deleted the old (moved) files.

Can I connect the file histories with each other? The best would be to se the "move" like it should have been done..

Thankful for any help!

+5  A: 

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.)

Commodore Jaeger
Definitely learn to integrate first. It makes many things easier, including tracking the history.
Caleb Huitt - cjhuitt