Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce: move directory with keeping history

Tags:

perforce

Colleagues,

I have two different directories:

- path/animals/dir1
- path/cars/dir2

I want to move dir1 into path/cars/ with keeping all history of this folder.

I tried several ways: merge, copy and rename/move using P4V, but all of them leads to erasing history in moved directory.

If there is a way how can I do it?

Thanks in advance!

like image 420
alex_bondar Avatar asked Aug 14 '13 10:08

alex_bondar


2 Answers

We have used p4 move extensively in recent versions of P4 to do these kinds of directory moves.

In my experience, if you branch/delete (or more recently move) the files, you'll have the history of the original location intact (with delete/move records), but if you look on a revision graph in P4V, you should see all of the older revisions in the previous locations before they were moved (deleted).

If you use p4 sync with a particular date or changelist, you should also get the original directory back with the versions of the files at that time (and the newly moved versions should be removed after the sync, assuming both directories were in the area that you were syncing).

I have experienced problems (this probably will change in 2013.2, as I've read that Perforce is changing the default integration engine) with integration across move/delete and move/add transactions which require the use "generation 3" integration option, but once that's specified (which you can do by adding a -3 to the command line p4 integrate command, everything works better for me across those moves.

like image 151
gaige Avatar answered Sep 18 '22 12:09

gaige


The history of the moved directory has not been erased. I'm guessing you think this is the case because the files are longer visible in P4V. By default, P4V does not display deleted files in the depot tree. Since you moved the files to a new location, they were deleted from their old location and are now no longer displayed. You need to turn on the option to "Show Deleted Depot Files". If you click on the yellow funnel icon to the right of the Depot/Workspace tabs you'll see that option. Check it and P4V will then display the deleted files in their original location.

enter image description here

like image 39
raven Avatar answered Sep 17 '22 12:09

raven