Using a label to specify file revisions

You can use a label name anywhere you can refer to files by revision (#1, #head), changelist number (@7381), or date (@2017/08/29).

If you omit file arguments when you issue the p4 sync @labelname command, all files in the workspace view that are tagged by the label are synced to the revision specified in the label. All files in the workspace that do not have revisions tagged by the label are deleted from the workspace. Open files or files not under Helix Server control are unaffected. This command is equivalent to p4 sync //...@labelname.

If you specify file arguments when you issue the p4 sync command (p4 sync files@labelname), files that are in your workspace and tagged by the label are synced to the tagged revision.

Example   Retrieving files tagged by a label into a client workspace

To retrieve the files tagged by Bruno’s jam-2.1.0 label into his client workspace, Bruno issues the following command:

$ p4 sync @ jam-2.1.0

and sees:

//JamCode/dev/jam/Build.com#5 - updating c:\bruno_ws\dev\jam\Build.com
//JamCode/dev/jam/command.c#5 - updating c:\bruno_ws\dev\jam\command.c
//JamCode/dev/jam/command.h#3 - added as c:\bruno_ws\dev\jam\command.h
//JamCode/dev/jam/compile.c#12 - updating c:\bruno_ws\dev\jam\compile.c
//JamCode/dev/jam/compile.h#2 - updating c:\bruno_ws\dev\jam\compile.h
...