dirArea = adminArea;
}
Collection tmpFiles = null;
SVNCommitInfo info = null;
ISVNEditor commitEditor = null;
try {
Map commitables = new TreeMap();
SVNEntry entry = wcAccess.getEntry(srcPath, false);
if (entry == null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, "''{0}'' is not under version control", srcPath);
SVNErrorManager.error(err);
return SVNCommitInfo.NULL;
}
SVNCommitUtil.harvestCommitables(commitables, dirArea, srcPath, null, entry, dstURL.toString(), entry.getURL(),
true, false, false, null, true, false, getCommitParameters());
items = (SVNCommitItem[]) commitables.values().toArray(new SVNCommitItem[commitables.values().size()]);
for (int i = 0; i < items.length; i++) {
items[i].setWCAccess(wcAccess);
}
commitables = new TreeMap();
dstURL = SVNURL.parseURIEncoded(SVNCommitUtil.translateCommitables(items, commitables));
repository = createRepository(dstURL, true);
SVNCommitMediator mediator = new SVNCommitMediator(commitables);
tmpFiles = mediator.getTmpFiles();
commitMessage = SVNCommitClient.validateCommitMessage(commitMessage);
SVNURL root = repository.getRepositoryRoot(true);
commitEditor = repository.getCommitEditor(commitMessage, null, false, mediator);
info = SVNCommitter.commit(tmpFiles, commitables, root.getPath(), commitEditor);
commitEditor = null;
} finally {
if (tmpFiles != null) {
for (Iterator files = tmpFiles.iterator(); files.hasNext();) {
File file = (File) files.next();
file.delete();
}
}
if (commitEditor != null && info == null) {
commitEditor.abortEdit();
}
if (wcAccess != null) {
wcAccess.close();
}
}