Previous Table of Contents Index Next
Perforce 2009.2: Command Reference



p4 delete
Synopsis
Open file(s) in a client workspace for deletion from the depot.
Syntax
p4 [g-opts] delete [-c changelist#] [-n -v] file...
Description
The p4 delete command opens file(s) in a client workspace for deletion from the depot. The files are immediately removed from the client workspace, but are not deleted from the depot until the corresponding changelist is sent to the server with p4 submit.
Although it will appear that a deleted file has been deleted from the depot, the file is never truly deleted, as older revisions of the same file are always accessible. Instead, a new head revision of the file is created which marks the file as being deleted. If p4 sync is used to bring the head revision of this file into another workspace, the file is deleted from that workspace.
A file that is open for deletion will not appear on the client's have list.
Options
-c change#
Opens the files for delete within the specified changelist.
Usage Notes
Can File Arguments Use
Revision Specifier?
A file that has been deleted from the client workspace with p4 delete can be reinstated in the client workspace and removed from the pending changelist with p4 revert. To do this, you must revert the deletion before submitting the changelist.
Perforce does not prevent users from opening files that are already open; its default scheme is to allow multiple users to open a file simultaneously, and then resolve file conflicts with p4 resolve. To prevent someone else from opening a file once you've opened it, use p4 lock. To determine whether or not another user already has a particular file open, use p4 opened -a file.
Examples
Opens the file called README in the depot's top level directory for deletion. The corresponding file within the client workspace is immediately deleted, but the file is not deleted from the depot until the default changelist is submitted.
Opens file in the current client workspace for deletion. The file is immediately removed from the client workspace, but won't be deleted from the depot until changelist 40 is sent to the server with p4 submit.
Related Commands
 


Previous Table of Contents Index Next

Perforce 2009.2: Command Reference
Copyright 1999-2009 Perforce Software.