Managing Labels

Labels can be used to mark important file revisions, for example, the set of file revisions used to build a particular software release. You can use labels to specify groups of related file revisions in operations like getting file revisions (syncing) and integration.

To use labels, you first define the label and then apply the label to file revisions in the depot. When you define a label, you specify a label view, which limits the files to which the label can be applied.

Create labels

  1. Choose File > New > Label....

  2. On the Label form, enter a name for the new label.

  3. Enter a description of the label.

  4. To prevent other users from modifying the label, select locked.

  5. Specify the label view one of two ways:

    • Graphically: on the View tab, select depot paths.

    • Textually: on the Form tab, specify the depot location of the files in the View field.

  6. Click Save.

Label files

To label a file, it must be in the label view and synced to your client workspace.

  1. Select a file and choose Actions > Label...

  2. On the Label Files dialog, enter or browse for the label you want to use.

  3. Click the Apply label to files radio button.

  4. (Optional) Add files to the label or remove them by clicking the Add or Remove buttons next to the Files/Folders field.

  5. Choose whether to label the latest revision of the files or a specific revision.

    You can specify a revision by revision number, changelist, date/time, workspace, or other label..

  6. Choose whether to exclude deleted revisions of the files.

  7. Click Label.

To remove a label from a set of files:

  1. Select a file and choose Actions>Label...

    The Label Files dialog is displayed.

  2. Browse for the label you want to use from the Label field.

  3. Choose the Remove selected label from files option.

  4. Click Label.

Display and search for labels

To display the labels defined for the Perforce depot to which you are connected, open the Labels tab (click the Labels icon in the toolbar or go to View>Labels).

To search for labels, use the filter fields on the Labels tab. You can filter by any combination of the following:

  • Owner

  • Label name

  • File paths

    You can enter as many file paths as you like. The filter retrieves labels associated with all files in all file paths entered (restricted by any owner and label name included in the filter). You can use the File Path Builder to construct file paths.

Note

Global labels display as grey when you are connected to an edge server. Grayed-out labels are not editable when you are connected to the edge server, regardless of permissions, but you can still use them.

For more information on using filters, see Searching and filtering.

Edit labels

  1. Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.

  2. Context-click the label and choose Edit Label 'label_name' .

    The Label form is displayed.

  3. Enter your changes, and click Save.

Editing a label does not change the list of files to which the label is applied.

Delete and unload labels

Deleting a label makes it unavailable for use and removes the label from files.

To delete a label:

  1. Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.

  2. Context-click the label and select Delete Label 'label_name'.

Unloading transfers infrequently-used metadata from the versioning engine's database files to a set of flat files in an unload depot. If you unload a label, you can reload it if you change your mind and want to use it again.

To unload a label:

  1. Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.

  2. Context-click the label and select Unload Label 'label_name'.

To reload an unloaded label:

  1. Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.

  2. Select the Unloaded... icon in the filter pane to open the Unloaded Labels dialog, where you can filter for and select unloaded labels to reload.

  3. Context-click the label and select Reload label 'label_name'.

For more information about unloading, see the Perforce Command Reference.

Retrieve file revisions in a label

To retrieve a labeled file revision using the Get Revision dialog:

  1. Go to View>Labels or click the Labels icon in the toolbar to open the Labels tab.

  2. Context-click the label you want and choose Get Revision...

    The Get Revision dialog opens.

  3. Click Add... to open the Add Files/Folders dialog.

  4. To retrieve all file revisions in a label, click the top-level folder (//). To retrieve a subset of the file revisions in the label, browse to the folders and files that you want and select them.

  5. Click OK to display the selected folders in the list of files to be retrieved.

  6. To ensure that your workspace contains only the labeled file revisions, select Remove files from workspace if they are not in label.

  7. Click Get Revision to retrieve the labeled file revisions.