Open topic with navigation
Store files from a pending changelist in the depot, without submitting them.
p4 [g-opts] shelve [-p] [file ...]
[ --parallel ]
p4 [g-opts] shelve [-a option] [-p] -i [-f | -r]
p4 [g-opts] shelve [-a option] [-p] -r -c change
p4 [g-opts] shelve [-a option] [-p] -c change [-f] [file ...]
p4 [g-opts] shelve -d -c change [-f] [file ...]
Shelving is the process of temporarily storing work in progress in Helix Core without submitting a changelist. Shelving is useful when you need to perform multiple development tasks (such as interruptions from higher-priority work, testing across multiple platforms) on the same set of files, or when you need to share files for code review before committing your work to the depot.
p4 shelve command creates, modifies, or discards
shelved files in a pending changelist. Shelved files persist in the depot
until they are discarded (by means of
p4 shelve -d)
or replaced by subsequent
p4 shelve commands.
p4 shelve displays the working revision for the files
In addition to the files being shelved,
also shelves any open stream specification. For more information on open
stream specifications, see
After shelving files, you can revert or modify them in your client
workspace. You can also restore the shelved versions of those files to
your workspace with the
While files are shelved, other users can unshelve the shelved files into their own workspaces, or into other client workspaces.
Files that have been shelved can also be accessed with the
p4 files, and
p4 print commands, using
the revision specifier
change is the pending changelist number.
If you are working in a distributed environment, use the
option to promote a shelved change from an edge server to a commit server
where it can be accessed by other edge servers in the distributed
configuration. When an existing shelved change is promoted, it is
promoted without modification unless the
-r options are also used to change the shelved file content.
For more information about the use of shelves in distributed
Helix Versioning Engine Administrator Guide: Multi-Site Deployment.
If no arguments are specified,
p4 shelve creates a
new changelist, adds files from the user’s default changelist, and (after
the user completes a form similar to that used by
p4 submit), shelves the
specified files into the depot. If a file pattern is given,
shelve shelves only the files that match the pattern.
In order to add a file to a pre-existing shelve, the file must first be
opened in the shelve’s changelist; use
p4 reopen to move an
opened file from one changelist to another.
p4 obliterate myfile does not obliterate a shelve
of the file (archive or metadata). When you attempt to unshelve a file
that has been obliterated, you will get an error. To recover the
content of that file, print the file. To get rid of the shelve, delete
Specify the pending changelist in which shelved files are to be created, discarded, or modified.
Only the user and client workspace that owns the pending
changelist can add or modify its shelved files. (Administrators
Any files specified by a file pattern must already be open in
the specified changelist; use
Discard the shelved files in the specified changelist so that
they are no longer available for
Only the user and workspace that owns the pending changelist can
discard its shelved files. (Administrators can use
Force the overwriting of any existing shelved files in a pending changelist with the contents of their client workspace copies.
administrators can use this option with
Read a changelist specification from standard input. Input must
be in the same format used by the
Promote a shelved change from an Edge server to a Commit server where it can be accessed by other edge servers participating in the distributed configuration. Once a shelved change has been promoted, all subsequent local modifications to the shelf are also pushed to the commit server and remain until the shelf is deleted. See Usage Notes for more information.
Replace all shelved files in the changelist with the files that are opened in your workspace.
Specifies that multiple files should be transferred in parallel, using independent network connections from automatically-invoked child processes. See also the configurables net.parallel.shelve.batch, net.parallel.shelve.min, and net.parallel.shelve.threads.
See Global Options.
|Can File Arguments Use Revision Specifier?||Can File Arguments Use Revision Range?||Minimal Access Level Required|
A promoted shelf is a shelf that exists on the Commit server of a
distributed configuration. It is there either because it was directly
created on the Commit server or because it was promoted with the
-p option of the
p4 shelve command.
Commands that access shelves know how to handle promoted shelves.
To unpromote a shelf, delete the shelf and create a new one.
A shelf can be promoted when it’s first created. A normal shelf can be promoted after it is created by running one of the following commands:
$ p4 shelve -p -f -c myChange $ p4 shelve -p -r -c myChange
Promoting a shelf gives you a way to move a shelf from one server to another. To do this, you must complete the following steps:
To determine whether a shelved change is promoted, you can try to access
the shelf on a server other than the server that owns the change, or you
can look at the output of the
Observe the following limitations when working with promoted shelves:
To restore shelved files into a workspace