alex_bondar
alex_bondar

Reputation: 442

Move directory with keeping history

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 lead to erasing history in moved directory.

If there is a way, how can I do it?

Upvotes: 6

Views: 9592

Answers (3)

alex_bondar
alex_bondar

Reputation: 442

While moving folder to another destination all history still present but only for appropriate files, not for a directories. Here is a proof: http://comments.gmane.org/gmane.comp.version-control.perforce/19820

Upvotes: 1

raven
raven

Reputation: 18115

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

Upvotes: 3

gaige
gaige

Reputation: 17471

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.

Upvotes: 6

Related Questions