p4 archive
Synopsis
Archive obsolete revisions to an archive depot.
Syntax
p4 [g-opts
] archive
[-h -n -p -q -t] -D depot
file
[revRange
]
…
Description
Moves the specified revisions into a depot
of
type archive
.
When files are moved into an archive depot, their last action is changed
to archive
. Commands that access file content (for
example, p4 sync,
p4 diff, and so on) skip
archive
revisions, but commands that do not require
access to file content (such as p4
filelog, for example) continue to report to metadata
concerning the archived revisions.
Warning
Use p4 archive -p with caution. This is one of only two commands in Perforce that actually removes file data. (The other command that removes file data is p4 obliterate.)
Options
|
Specify an archive depot to which files are to be archived. |
|
Do not archive head revisions. |
|
Do not archive revisions; report on which revisions would have been archived. |
|
Purge any archives of the specified files named in the archive
depot. (The action for affected revisions is set to
|
|
Quiet mode; suppress messages about skipped revisions. |
|
Archive text files (or other revisions stored in delta format,
such as files of type |
|
See “Global Options”. |
Usage Notes
Can File Arguments Use Revision Specifier? |
Can File Arguments Use Revision Range? |
Minimal Access Level Required |
---|---|---|
Yes |
Yes |
admin
|
-
By default, only files stored in full (
+F
) or compressed (+C
) are archived. The files must be in alocal
depot (not aremote
or anotherarchive
depot), and must neither be copied nor branched to (or from) another revision. -
To archive files stored in delta format, use the
-t
option. Be aware that there may be a computational cost associated with the manipulation of large numbers of RCS deltas. -
You can use p4 archive -n for testing purposes before mounting the filesystem associated with the archive depot. Storage for the archive depot must be mounted before running this command without the
-n
option. -
If a single revision is specified as a file argument, p4 archive implicitly targets revisions #1 through the specified revision for archiving. To archive only a single revision
rev
, use the form p4 archive file#rev
,rev
. -
If a revision is stored in an archive depot, and the stored revision is accessible to the versioning service, end users can use p4 print -A -o
filename
to a file in order to determine which archived revision(s) are desired before (optionally) requesting that a Perforce Administrator use p4 restore to restore the file.
Examples
p4 archive |
Archive revisions 1, 2, and 3 of
|
p4 archive |
Archive revision 3 of |
p4 print -A -o |
Display the contents of an archived
|