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
-
Choose File > New > Label....
-
On the Label form, enter a name for the new label.
-
Enter a description of the label.
-
To prevent other users from modifying the label, select locked.
-
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.
-
-
Click Save.
Label files
To label a file, it must be in the label view and synced to your client workspace.
-
Select a file and choose Actions > Label...
-
On the Label Files dialog, enter or browse for the label you want to use.
-
Click the Apply label to files radio button.
-
(Optional) Add files to the label or remove them by clicking the Add or Remove buttons next to the Files/Folders field.
-
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..
-
Choose whether to exclude deleted revisions of the files.
-
Click Label.
To remove a label from a set of files:
-
Select a file and choose Actions>Label...
The Label Files dialog is displayed.
-
Browse for the label you want to use from the Label field.
-
Choose the Remove selected label from files option.
-
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
-
Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.
-
Context-click the label and choose Edit Label
'label_name'
.The Label form is displayed.
-
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:
-
Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.
-
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:
-
Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.
-
Context-click the label and select Unload Label 'label_name'.
To reload an unloaded label:
-
Go to View > Labels or click the Labels icon in the toolbar to open the Labels tab.
-
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.
-
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:
-
Go to View>Labels or click the Labels icon in the toolbar to open the Labels tab.
-
Context-click the label you want and choose Get Revision...
The Get Revision dialog opens.
-
Click Add... to open the Add Files/Folders dialog.
-
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.
-
Click OK to display the selected folders in the list of files to be retrieved.
-
To ensure that your workspace contains only the labeled file revisions, select Remove files from workspace if they are not in label.
-
Click Get Revision to retrieve the labeled file revisions.