if (myEventHandler != null) {
if (handler.getDroppedRevisionsCount() > 0) {
String message = MessageFormat.format("Dropped {0} revision(s).", new Object[] {
String.valueOf(handler.getDroppedRevisionsCount()) });
SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.DUMP_FILTER_TOTAL_REVISIONS_DROPPED,
message);
event.setDroppedRevisionsCount(handler.getDroppedRevisionsCount());
myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
}
if (renumberRevisions) {
Map renumberHistory = handler.getRenumberHistory();
Long[] reNumberedRevisions = (Long[]) renumberHistory.keySet().toArray(new Long[renumberHistory.size()]);
Arrays.sort(reNumberedRevisions);
for (int i = reNumberedRevisions.length; i > 0; i--) {
Long revision = reNumberedRevisions[i - 1];
DefaultDumpFilterHandler.RevisionItem revItem = (DefaultDumpFilterHandler.RevisionItem) renumberHistory.get(revision);
if (revItem.wasDropped()) {
String message = MessageFormat.format("{0} => (dropped)", new Object[] { revision.toString() });
SVNAdminEvent event = new SVNAdminEvent(revision.longValue(),
SVNAdminEventAction.DUMP_FILTER_DROPPED_RENUMBERED_REVISION, message);
myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
} else {
String message = MessageFormat.format("{0} => {1}", new Object[] { revision.toString(),
String.valueOf(revItem.getRevision()) });
SVNAdminEvent event = new SVNAdminEvent(revItem.getRevision(), revision.longValue(),
SVNAdminEventAction.DUMP_FILTER_RENUMBERED_REVISION, message);
myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
}
}
}
Map droppedNodes = handler.getDroppedNodes();
if (!droppedNodes.isEmpty()) {
String message = MessageFormat.format("Dropped {0} node(s)", new Object[] {
String.valueOf(droppedNodes.size()) });
SVNAdminEvent event = new SVNAdminEvent(SVNAdminEventAction.DUMP_FILTER_TOTAL_NODES_DROPPED,
message);
event.setDroppedNodesCount(droppedNodes.size());
myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
String[] paths = (String[]) droppedNodes.keySet().toArray(new String[droppedNodes.size()]);
Arrays.sort(paths, SVNPathUtil.PATH_COMPARATOR);
for (int i = 0; i < paths.length; i++) {
String path = paths[i];
message = "'" + path + "'";
event = new SVNAdminEvent(SVNAdminEventAction.DUMP_FILTER_DROPPED_NODE, path, message);
myEventHandler.handleAdminEvent(event, ISVNEventHandler.UNKNOWN);
}
}
}
}