Wednesday, October 19, 2011

Learning the use of "p4 duplicate" command

Another way is to deep rename it:

p4 duplicate //depot/bad_branch_name/... //depot/correct_branch_name/...

Now at that point take a look at the revision graph of some of the files. You'll see that even the integration history is duplicated. This is a command that effectively changes the past.
then:

p4 obliterate (-y) //depot/bad_branch_name/...

However, depending on where the librarian files actually are (check using p4 fstat -Oc //depot/bad_branch_name/... and look for the lbrFile value) you may want to relocate them to the renamed branch before obliterating if they are not lazy copies. Using p4 snap, so for example p4 snap //depot/bad_branch_name/... //depot/correct_branch_name/...

1 comment:

Anonymous said...

Hi Siddesh,

You blog is helpful to me. I have some questions regarding Perforce can you help me out.

Question :
If we want to put one of those subdirectories in a separate depot, are
we going to lose the Perforce history for that application or can you
move that history to the new depot?