RepositoryCreateBranchSpec Method (BranchSpec)
|
Create a new branch in the repository.
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.2.269.3570
Syntax public BranchSpec CreateBranchSpec(
BranchSpec branch
)
Public Function CreateBranchSpec (
branch As BranchSpec
) As BranchSpec
public:
BranchSpec^ CreateBranchSpec(
BranchSpec^ branch
)
member CreateBranchSpec :
branch : BranchSpec -> BranchSpec
Parameters
- branch
- Type: Perforce.P4BranchSpec
Branch specification for the new branch
Return Value
Type:
BranchSpecThe Branch object if new branch was created, null if creation failed
Examples
To create a basic branch spec:
BranchSpec newBranchSpec = new BranchSpec();
newBranchSpec.Id = "newBranchSpec";
newBranchSpec.ViewMap = new ViewMap();
string v0 = "//depot/main/... //depot/rel1/...";
newBranchSpec.ViewMap.Add(v0);
_repository.CreateBranchSpec(newBranchSpec);
See Also