RepositoryUpdateBranchSpec Method
|
Update the record for a branch in the repository
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.1.265.5426
Syntax public BranchSpec UpdateBranchSpec(
BranchSpec branch
)
Public Function UpdateBranchSpec (
branch As BranchSpec
) As BranchSpec
public:
BranchSpec^ UpdateBranchSpec(
BranchSpec^ branch
)
member UpdateBranchSpec :
branch : BranchSpec -> BranchSpec
Parameters
- branch
- Type: Perforce.P4BranchSpec
Branch specification for the branch being updated
Return Value
Type:
BranchSpecThe Branch object if new depot was saved, null if creation failed
Examples
To append a view to an existing branch spec:
BranchSpec updateBranchSpec = _repository.GetBranchSpec("newBranchSpec");
string v0 = "\"//depot/main/a file with spaces.txt\" \"//depot/rel1/a file with spaces.txt\"";
updateBranchSpec.ViewMap.Add(v0);
_repository.UpdateBranchSpec(updateBranchSpec);
To lock a branch spec:
BranchSpec updateBranchSpec = _repository.GetBranchSpec("newBranchSpec");
updateBranchSpec.Locked = true;
_repository.UpdateBranchSpec(updateBranchSpec);
See Also