RepositoryDeleteBranchSpec Method
|
Delete a branch from the repository
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.1.265.5426
Syntax public void DeleteBranchSpec(
BranchSpec branch,
Options options
)
Public Sub DeleteBranchSpec (
branch As BranchSpec,
options As Options
)
public:
void DeleteBranchSpec(
BranchSpec^ branch,
Options^ options
)
member DeleteBranchSpec :
branch : BranchSpec *
options : Options -> unit
Parameters
- branch
- Type: Perforce.P4BranchSpec
The branch to be deleted - options
- Type: Perforce.P4Options
The '-f' and '-d' flags are valid when deleting an
existing branch
Examples
To delete a branch spec owned by you [-d implied]:
BranchSpec deleteBranchSpec = new BranchSpec();
deleteBranchSpec.Id = "newBranchSpec";
_repository.DeleteBranchSpec(deleteBranchSpec, null);
To delete a branch owned by someone other than you [-d implied] [-f requires admin privileges]:
BranchSpec deleteBranchSpec = new BranchSpec();
deleteBranchSpec.Id = "newBranchSpec";
Options opts = new Options(BranchSpecsCmdFlags.Force);
_repository.DeleteBranchSpec(deleteBranchSpec, opts);
See Also