Click or drag to resize

RepositoryCreateLabel Method (Label)

Create a new label in the repository.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public Label CreateLabel(
	Label label
)

Parameters

label
Type: Perforce.P4Label
Label specification for the new label

Return Value

Type: Label
The 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