Update the record for a branch in the repository
Namespace: Perforce.P4Assembly: p4api.net (in p4api.net.dll) Version: 2015.1.103.4687 (2015.1.103.4687)
Syntax
C# |
---|
public BranchSpec UpdateBranchSpec( BranchSpec branch ) |
Visual Basic |
---|
Public Function UpdateBranchSpec ( _ branch As BranchSpec _ ) As BranchSpec |
Visual C++ |
---|
public: BranchSpec^ UpdateBranchSpec( BranchSpec^ branch ) |
Parameters
- branch
- Type: Perforce.P4..::..BranchSpec
Branch specification for the branch being updated
Return Value
The Branch object if new depot was saved, null if creation failed
Examples
To append a view to an existing branch spec:
CopyC#
To lock a branch spec:
CopyC#

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);

BranchSpec updateBranchSpec = _repository.GetBranchSpec("newBranchSpec"); updateBranchSpec.Locked = true; _repository.UpdateBranchSpec(updateBranchSpec);