Get a list of labels from the repository
Namespace: Perforce.P4Assembly: p4api.net (in p4api.net.dll) Version: 2015.1.103.4687 (2015.1.103.4687)
Syntax
C# |
---|
public IList<Label> GetLabels( Options options, params FileSpec[] files ) |
Visual Basic |
---|
Public Function GetLabels ( _ options As Options, _ ParamArray files As FileSpec() _ ) As IList(Of Label) |
Visual C++ |
---|
public: IList<Label^>^ GetLabels( Options^ options, ... array<FileSpec^>^ files ) |
Return Value
A list containing the matching labels
Remarks
p4 help labels
p4 labels [-t] [-u user] [[-e|-E] nameFilter -m max] [file[revrange]]
p4 labels [-t] [-u user] [[-e|-E] nameFilter -m max] [-a|-s serverID]
p4 labels -U
Lists labels defined in the server.
If files are specified, 'p4 labels' lists the labels that contain
those files. If you include a file specification, automatic labels
and labels with the 'autoreload' option set are omitted from the list.
If the file specification includes a revision range, 'p4 labels'
lists labels that contain the specified revisions.
See 'p4 help revisions' for details about specifying revisions.
The -t flag displays the time as well as the date.
The -u user flag lists labels owned by the specified user.
The -e nameFilter flag lists labels with names that match the
the nameFilter pattern, for example: -e 'svr-dev-rel*'. -E makes
the matching case-insensitive.
The -m max flag limits output to the first 'max' number of labels.
The -U flag lists unloaded labels (see 'p4 help unload').
The -a and -s flags are useful in a distributed server installation
(see 'p4 help distributed') in order to see the names of local labels
stored on other Edge Servers. These flags are not allowed if the
command includes a file specification.
The -a flag specifies that all labels should be displayed, not just
those that are bound to this server.
The -s serverID flag specifies that only those labels bound to the
specified serverID should be displayed.
On an Edge Server, if neither -s nor -a is specified, only those
local labels bound to this Edge Server are displayed. Labels created
on the Commit Server are global, and are also included in the output.
Examples
To get 50 labels on a distributed server installation:
CopyC#
To get labels which contain files with the path //depot/Modifiers/...:
CopyC#

LabelsCmdOptions opts = new LabelsCmdOptions(LabelsCmdFlags.All, null, null, 50, null, null); IList<Label> labels = rep.GetLabels(opts);

FileSpec path = new FileSpec(new DepotPath("//depot/Modifiers/..."), null); Options ops = new Options(); IList<Label> l = rep.GetLabels(ops, path);