Perforce 2006.1 Command Reference
<< Previous Chapter
p4 monitor
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 opened

p4 obliterate

Synopsis

Removes files and their history from the depot.

Syntax

p4 [g-opts] obliterate [ -y ] [ -z ] file[revRange] ...

Warning

The p4 delete command marks the latest revision as deleted, but leaves the file information intact in the depot. As such, recovery from the server data is always possible.

In contrast, p4 obliterate deletes the file data itself, precluding any possibility of recovery.

Use p4 obliterate with caution. This is the only command in Perforce that actually removes file data.

Description

p4 obliterate can be used by Perforce administrators to permanently remove files from the depot. All information about the files is wiped out, including the files' revisions, the files' metadata, and any records in any labels or client workspace records that refer directly to those files. Once p4 obliterate completes, it appears to the server as if the affected file(s) had never existed. Copies of files in client workspaces are left untouched, but are no longer recognized as being under Perforce control.

p4 obliterate requires at least one file pattern as an argument. To actually perform the obliteration, the -y flag is required; without it, p4 obliterate merely reports what it would do without actually performing the obliteration.

If you specify a single revision (for instance, p4 obliterate file#3), only that revision of the file is obliterated. If you specify a revision range (for instance, p4 obliterate file#3,5), only the revisions in that range are obliterated.

The -z flag is used with branches; after branching a file from one area of the depot into another. When a branch is made, a "lazy copy" is performed - the file itself isn't copied; only a record of the branch is made. If you want to "obliterate" the lazy copy performed by the branch, thereby creating an extra copy of the file in the depot, use p4 obliterate -z on it. Note that this typically increases disk space usage.

Options

-y filespec

Perform the obliterate operation. Without this flag, p4 obliterate merely reports what it would do.

-z filespec

Undo "lazy copies" only; remove no files nor metadata. This option is most commonly used when working with branches in order to ensure that no other files in the database refer to the named files.

g-opts

See the Global Options section.

Usage Notes

Can File Arguments Use
Revision Specifier?

Can File Arguments Use
Revision Range?

Minimal Access Level Required

Yes

Yes

admin

In this case, a developer using the #4 in the first line of the output to assume the existence of four change descriptions in the output of p4 filelog would be in trouble.

Examples

p4 obliterate dir/...

Do not obliterate any files; list the files that would be obliterated with the -y option.

In this case, all files in directory dir and below would be subject to deletion with the -y option.

p4 obliterate -y file

Obliterate file from the depot. All history and metadata for every revision of file are erased.

p4 obliterate -y file#3

Obliterate only the third revision of file.

If #3 was the head revision, the new head revision is now #2 and the next revision will be revision #3.

If #3 was not the head revision, the head revision remains unchanged.

p4 obliterate -y file#3,5

Obliterate revisions 3, 4, and 5 of file.

If #5 was the head revision, the new head revision is now #2, and the next revision will be #3.

If #5 was not the head revision, the head revision remains unchanged.

Related Commands

To mark a file deleted at its head revision but leave it in the depot. This is the normal way of deleting files.

p4 delete


Perforce 2006.1 Command Reference
<< Previous Chapter
p4 monitor
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 opened
Please send comments and questions about this manual to [email protected].
Copyright 1999-2006 Perforce Software. All rights reserved.
Last updated: 06/23/06