Shelving files

ShelvingThe process of temporarily storing files in the Helix Server without checking in a changelist. enables you to store copies of open files temporarily in the shared Helix Server repository without checking them in. Shelving is useful for a variety of purposes, including taking and restoring snapshots of in-progress work and reviewing other users' code before it’s checked in. When you shelve a file, a copy is placed in a pending changelistA changelist that has not been submitted. from which other users can unshelve it. Pending changelists that contain shelved files are displayed with the following icon and badge: shelved changelist . When the changelist is expanded, shelved files are listed under the Shelved Files node, indicated with the following icon: shelved file .

When you manage shelved files, note the following:

Shelve checked-out files in a pending changelist

  1. Right-click the changelist and select Shelve.

    P4V displays the Shelve dialog.

  2. Select the files you want to shelve and click Shelve.
  3. Select any of the following options that apply:

  4. When prompted, enter a description and click OK.

    P4V shelves the file in the selected changelist (or, if you are shelving files in the default changelist, creates a new changelist).

Alternately, you can shelve a checked-out file by dragging it from the pending changelist or depot pane to the Shelved Files node of the changelist where you want it shelved.

Unshelve files

After shelving a file, you or another user can unshelve it, which restores the shelved copy to your workspace and opens it in the changelist of your choice. Unshelving does not remove files from the shelf.

To unshelve a file that was shelved by another user, you must have permission to check out the file. When you unshelve a file that was shelved by another user, it is copied to one of your changelists, from which you can then edit and submit the file.

Note

When unshelving a file that was shelved at an earlier revision into a workspace that has a later revision of the same file, P4V replaces the existing revision number in the workspace with the revision number under which the file was shelved.

Example    

If a workspace has the head revision of a submitted file, such as #5, and you then unshelve from a pending changelist the same file that was shelved at an earlier revision, such as #4, with some additional changes in the shelved file, the workspace tree will change to show the revision number of the file in the shelve, such as #4/5. The file in the workspace now contains the content of the shelved file, that is revision #4 from the depot plus any additional changes made in the shelve.

In this case, to submit an unshelved file revision that is different from the head revision in the depot, you first need to get the latest revision from the depot, resolve differences, and then submit the changes, as follows:

  1. Right-click the file and select Get Latest Revision to get the submitted head revision from the depot. This evokes the action to schedule a resolve.
  2. Resolve the differences between the unshelved file revision in the workspace and the submitted head revision retrieved from the depot.
  3. Submit the changes.

To unshelve files in a pending changelist:

  1. Right-click the file changelist choose Unshelve​.

    P4V displays the Unshelve dialog.

  2. Check the files you want to unshelve and click Unshelve and any other desired options.

    The shelved file is copied to your workspace and opened in the specified changelist.

To unshelve a file into a different branch than the one it was shelved in:

Note

Unshelving shelved changes into different branches or related streams is only available with Helix Server 2013.1 or later.

  1. Select the Map unshelved files checkbox on the Unshelve dialog.
  2. Select the way you want to map the unshelved files to the target branch:

Submit shelved files

As of Helix Server 2013.1, you can submit shelved files directly.

Note

If there are non-shelved files along with shelved files in a pending changelist, you must first revert the non-shelved files or move them to another changelist. You cannot submit shelved files from a task stream.

To submit shelved files in a pending changelist, right-click the changelist or shelved files folder and choose Submit Shelved Files.

Delete shelved files

Shelved files remain shelved until you delete them from the pending changelist. To delete a shelved file from a pending changelist, right-click the file and choose Delete. Alternately, right-click the pending changelist and choose Delete Shelved Files​.