private void resumeImport() throws SVNImporterException, SVNException {
// First I reconnect to SVN repository
fConnector.connectSVN();
LOGGER.info(ImporterMessages.EvolizerSVNImporter_reconnected);
fMonitor.subTask(NLS.bind(ImporterMessages.EvolizerSVNImporter_performingRollback, fCurrRev));
SVNLogEntry entry = null;
try {
entry = fConnector.getRevision(fCurrRev);
} catch (NoSuchElementException e) {
throw new SVNImporterException(NLS.bind(
ImporterMessages.EvolizerSVNImporter_problemResumingFromRevision,
fCurrRev));
}
/*
* I proceed to clean up the data of the last revision found, so I don't run into inconsistencies.
* The way I do it depends on whether the repository is a standard one or not.
*/
// Sometimes log entries can be empty, I will just skip them
if (!entry.getChangedPaths().isEmpty()) {
// Check if it was a standard release
if (isRelease(entry)) {
LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundRelease, entry.getRevision()));
TreeMap<String, SVNLogEntryPath> sortedPaths =
new TreeMap<String, SVNLogEntryPath>(entry.getChangedPaths());
SVNLogEntryPath tagPath = sortedPaths.values().iterator().next();
fModelMapper.deleteRelease(entry.getRevision(), entry.getAuthor(), tagPath.getPath());
} else if (isBranch(entry, true) || isSubBranch(entry, true)) {
LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundBranch, entry.getRevision()));
Map<String, SVNLogEntryPath> sortedPaths =
new TreeMap<String, SVNLogEntryPath>(entry.getChangedPaths());
SVNLogEntryPath tagPath = sortedPaths.values().iterator().next();
fModelMapper.deleteBranch(entry.getRevision(), entry.getAuthor(), getBranchName(entry, tagPath));
} else {
LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundRevision, entry.getRevision()));
String path = null;
if (this.isInBranch(((SVNLogEntryPath) entry.getChangedPaths().values().iterator().next()).getPath())
&& (this.fConnector.isStandardSVNLayout() || this.usingCustomPaths)) {
path = ((SVNLogEntryPath) entry.getChangedPaths().values().iterator().next()).getPath();
}
fModelMapper.deleteRevision(entry.getRevision(), entry.getAuthor(), path);
}
}
fBeginImport = fCurrRev;
// Then I create a representation