Update the record for a branch in the repository

Namespace: Perforce.P4
Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)

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#
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:
CopyC#
BranchSpec updateBranchSpec = _repository.GetBranchSpec("newBranchSpec");
updateBranchSpec.Locked = true;
_repository.UpdateBranchSpec(updateBranchSpec);

See Also