*/
public void deleteBranch(long revNum, String author, String branchName) {
fRevisionElemsCache.clear();
fCurrBranches = new ArrayList<Branch>();
Branch branch = fBranches.get(branchName);
if (branch != null) {
fPersistenceProvider.startTransaction();
fPersistenceProvider.saveObject(branch);
cleanUpCommitter(revNum, author);
if (branch.getParent() != null) {
Set<Branch> children = branch.getParent().getChildren();
children.remove(branch);
branch.getParent().setChildren(children);
if (branch.getParent().getId() != null) {
fPersistenceProvider.update(branch.getParent());
}
}
((SVNRevision) branch.getRevisions().iterator().next()).getChangeSet().setInvolvedRevisions(null);
for (Revision rev : branch.getRevisions()) {
if (((SVNRevision) rev).getAncestor() != null) {
((SVNVersionedFile) ((SVNRevision) rev).getAncestor().getFile()).setCopiedTo(null);
}
((SVNRevision) rev).setAncestor(null);
List<Revision> rvs = ((SVNVersionedFile) rev.getFile()).getRevisions();
rvs.clear();
((SVNVersionedFile) rev.getFile()).setRevisions(rvs);
if (((SVNVersionedFile) rev.getFile()).getCopiedFrom() != null) {
((SVNVersionedFile) rev.getFile()).getCopiedFrom().setCopiedTo(null);
fPersistenceProvider.update(((SVNVersionedFile) rev.getFile()).getCopiedFrom());
}
if (rev.getFile().getId() != null) {
fPersistenceProvider.update(rev.getFile());
}
fFiles.remove(rev.getFile().getPath());
rev.setReport(null);
}
fPersistenceProvider.delete(branch);
fBranches.remove(branchName);
fPersistenceProvider.endTransaction();
fPersistenceProvider.flush();
LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_deletedBranch, branch.getName()));
}
}