Saturday 6 November 2010

Deleting a File Without Syncing

Why do I need to sync a file to my workspace before opening it for delete? How do I open a file for delete without syncing it?

A Perforce Server will use a workspace's 'have' list to calculate which files should be opened for delete. The 'have' list for a workspace is updated when a workspace is synced. So, if a file has not been synced, it will not be in a workspace's 'have' list, and it will not be eligible for delete.

It is possible to update a workspace's 'have' list without syncing the files to a workspace using p4 sync -k or p4 flush.

After updating the workspace's 'have' list, you should be able to open the files for delete, like so:

p4 sync -k //depot/dirA/...p4 delete //depot/dirA/...p4 submitIn the 2009.1 release of Perforce this behaviour was changed, and it is now possible to delete a file within a Perforce Server without syncing it to a workspace: #193862 (Bug #25041) **Change p4 delete to allow 'virtual delete' -- deletionof files in the depot without first syncing them intothe client workspace. Implemented with a new flag, -v.So, you could run: p4 delete -v //depot/dirA/...p4 submitto delete all files under "//depot/dirA/" without syncing them to a workspace. Please note, to take advantage of this feature you will need to upgrade your Perforce Server to 2009.1 or later.

View the original article here

No comments:

Post a Comment