Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server-side copy/move of a Perforce folder - without local sync of files

On the project I'm currently working on, we have lots of folders in the /branches and /tags folders (left after the migration from Subversion to Perforce).

I want to clean up the mess - I want to move/copy/rename folders remotely, directly on the depot, without getting them locally. I can't get them locally because we're talking about hundreds of GB and probably millions of files - dozens of branches x ~5GB.

Is it possible to order Perforce to move the folders just on the server?

(I do not have direct access to the Perforce machine, I cannot move folders around on the server or update the Perforce database).

like image 932
oblio Avatar asked Apr 10 '12 19:04

oblio


People also ask

What does clean do in perforce?

The p4 clean command takes the following actions when finding inconsistencies between files in a user's workspace and corresponding depot files: Files present in the workspace, but missing from the depot are deleted from the workspace. Files present in the depot, but missing from your workspace.

What does p4 copy do?

Description. Using the client workspace as a staging area, the p4 copy command propagates an exact copy of the source files to the specified target by branching, replacing, or deleting files. No manual resolve is required. Changes in the target that were not previously merged into the source are overwritten.

What is perforce checkout?

Perforce allows you to check out the head revision or any previous revision of a file. To enforce the IDEs' check-in and check-out procedures, Perforce controls the read-write permissions of files. When files are checked out for edit, their permissions are set to read-write.


2 Answers

p4 copy -v allows you to copy files in the depot without syncing those files to your workspace. (See the copy reference for more details.)

p4 delete -v allows you to delete files in the depot that are not synced to your workspace. (See the delete reference or KB Article #1148 for more details.)

Also p4 move -k allows you to move files in the depot without moving them locally, but I'm not sure if that applies if you don't have them synced to your workspace. (See the move reference for more details.)

You can also accomplish a move with a copy followed by a delete.

like image 147
Jon-Eric Avatar answered Sep 21 '22 05:09

Jon-Eric


I think that you can construct a workspace that maps all the files in question. You can run sync -k to make Perforce think you have the files locally. Then you can run move -k to move the files on the server.

Just FYI, p4 copy creates a new branch, whereas p4 move moves an existing branch to a new location.

like image 32
randy-wandisco Avatar answered Sep 22 '22 05:09

randy-wandisco