Delete your shelf

If you have a number of unused shelves, you can delete them if you want to tidy up your workspace.

By default, when you delete files from a shelved changelist, the files are not removed from the associated review.

However, P4 Code Review can be configured to remove files from a review when they are deleted from an associated shelf, see Process shelf file delete when.

Do not use the P4 Code Review user that is configured in the P4 Code Review configuration file when deleting shelves, or deleting files from shelves. The P4 Code Review logic processes the shelve-delete trigger event, if the event is invoked by the P4 Code Review user it is rejected. The delete operations will fail.

To delete a shelf from a changelist without removing the shelved files from the associated review, use P4 command-line (P4) or P4V to delete the entire shelf in one operation as described below. This enables you to delete a shelved changelist in your workspace without affecting the associated review even if P4 Code Review is configured to remove files from a review when they are deleted from a shelf.

Using P4 command-line (P4)

To delete a shelved changelist without removing the files from the associated review:

  1. Use a command-line shell and type:
  2. $ p4 shelve -d -c changelist

    Do not delete the files from the shelf individually. Deleting the entire shelf ensures that files are not removed from an associated review even if P4 Code Review is configured to do so.

  3. The shelved files are deleted from the pending changelist.

Using P4V

To delete a shelved changelist without removing the files from the associated review:

  1. In P4V, right-click on the pending changelist.
  2. Select Delete Shelved Files.
  3. Do not delete the files from the shelf individually. Deleting the entire shelf ensures that files are not removed from an associated review even if P4 Code Review is configured to do so.

  4. The shelved files are deleted from the pending changelist.