Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I copy, modify, then submit a file in Perforce, will the copy still retain the original's history?

Tags:

perforce

Suppose I have a file A.txt in my Perforce client workspace, which already exists on the server as //depot/A.txt. Now, suppose I want to make a copy of A.txt, call it B.txt, and make some changes to B.txt before I commit it to the server. I might do this like so:

p4 integrate A.txt B.txt
p4 edit B.txt
vim B.txt
p4 submit

Will Perforce remember that B.txt started out as a copy of A.txt? For example, if I run p4 filelog B.txt, will it show that //depot/B.txt was originally branched from //depot/A.txt ?

(Actually, I already know the answer, but it was not so easy to figure out without actually trying it completely, thanks to p4's characteristically confusing output. So I figure I'll ask the question so that someone can provide an answer for the record.)

like image 948
Michael Ratanapintha Avatar asked Jan 11 '12 02:01

Michael Ratanapintha


1 Answers

The answer, for the record, is yes. Remember to use the -i ("inherited history") flag on p4 filelog.

like image 102
user1054341 Avatar answered Oct 11 '22 15:10

user1054341