RepositoryCreateLabel Method (Label)
|
Create a new label in the repository.
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.1.261.8274
Syntaxpublic Label CreateLabel(
Label label
)
Public Function CreateLabel (
label As Label
) As Label
public:
Label^ CreateLabel(
Label^ label
)
member CreateLabel :
label : Label -> Label
Parameters
- label
- Type: Perforce.P4Label
Label specification for the new label
Return Value
Type:
LabelThe Label object if new label was created, null if creation failed
Examples
To create a new label:
Label l = new Label();
l.Id = "newLabel";
l.Owner = "admin";
l.Description = "created by admin";
l.Options = "unlocked";
l.ViewMap = new ViewMap();
string v0 = "//depot/main/...";
string v1 = "//depot/rel1/...";
string v2 = "//depot/rel2/...";
string v3 = "//depot/dev/...";
l.ViewMap.Add(v0);
l.ViewMap.Add(v1);
l.ViewMap.Add(v2);
l.ViewMap.Add(v3);
Label newLabel = rep.CreateLabel(l, null);
See Also