Finding File Revisions in Labels
TASK
How do I find specific revisions of a file in a label?SOLUTION
To find labels that contain specific revisions of a file, you must provide an appropriate revision specifier, as detailed below.
You can find out if any revison of a file is in a label by using the following command:
p4 labels file
To find the labels that only apply to a specific revision of a file, use the "#rev,rev" syntax. For example:
p4 labels //depot/path/to/foo.java#3,3
The "#3,3" revision range (for a single revision) can also be written as "#=3".
When providing a single revision specifier, for example, "foo.java#3", the labels command will return all labels up to and including the specified revision. In other words, the single revision specifier "#3" is equivalent to "#<=3" and labels containing "foo.java#1" would be reported.
To see which labels are tagged to specific revisions in your client workspace, use the #have,have or #=have revision specifier.
Example
C:\aaa\p4work>p4 labels jobchanges.qry Label test 2003/03/05 'Created by michael. ' Label test2 2003/02/26 'Created by michael. ' Label test3 2003/07/15 'Created by michael. ' C:\aaa\p4work>p4 labels jobchanges.qry#2 Label test 2003/03/05 'Created by michael. ' Label test2 2003/02/26 'Created by michael. ' C:\aaa\p4work>p4 labels jobchanges.qry#2,2 Label test2 2003/02/26 'Created by michael. ' C:\aaa\p4work>p4 labels jobchanges.qry#3,3 Label test3 2003/07/15 'Created by michael. ' C:\aaa\p4work>p4 labels jobchanges.qry#=have Label test 2003/03/05 'Created by michael. '
