myRepositoryRoot = reposRoot;
}
public boolean handleCommitPath(String commitPath, ISVNEditor commitEditor) throws SVNException {
SVNCommitItem item = (SVNCommitItem) myCommitItems.get(commitPath);
SVNWCAccess wcAccess = item.getWCAccess();
wcAccess.checkCancelled();
if (item.isCopied()) {
if (item.getCopyFromURL() == null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_URL, "Commit item ''{0}'' has copy flag but no copyfrom URL", item.getFile());
SVNErrorManager.error(err, SVNLogType.WC);
} else if (item.getRevision().getNumber() < 0) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION, "Commit item ''{0}'' has copy flag but an invalid revision", item.getFile());
SVNErrorManager.error(err, SVNLogType.WC);
}
}
SVNEvent event = null;
boolean closeDir = false;
File file = null;
if (item.getFile() != null) {
file = item.getFile();
} else if (item.getPath() != null) {
file = new File(wcAccess.getAnchor(), item.getPath());
}
long rev = item.getRevision().getNumber();
if (item.isAdded() && item.isDeleted()) {
event = SVNEventFactory.createSVNEvent(file, item.getKind(), null, SVNRepository.INVALID_REVISION, SVNEventAction.COMMIT_REPLACED, null, null, null);
event.setPreviousRevision(rev);
} else if (item.isAdded()) {
String mimeType = null;
if (item.getKind() == SVNNodeKind.FILE && file != null) {
SVNAdminArea dir = item.getWCAccess().retrieve(file.getParentFile());
mimeType = dir.getProperties(file.getName()).getStringPropertyValue(SVNProperty.MIME_TYPE);
}
event = SVNEventFactory.createSVNEvent(file, item.getKind(), mimeType, SVNRepository.INVALID_REVISION, SVNEventAction.COMMIT_ADDED, null, null, null);
event.setPreviousRevision(item.getCopyFromRevision() != null ? item.getCopyFromRevision().getNumber() : -1);
event.setPreviousURL(item.getCopyFromURL());
} else if (item.isDeleted()) {
event = SVNEventFactory.createSVNEvent(file, item.getKind(), null, SVNRepository.INVALID_REVISION, SVNEventAction.COMMIT_DELETED, null, null, null);
event.setPreviousRevision(rev);
} else if (item.isContentsModified() || item.isPropertiesModified()) {
event = SVNEventFactory.createSVNEvent(file, item.getKind(), null, SVNRepository.INVALID_REVISION, SVNEventAction.COMMIT_MODIFIED, null, null, null);
event.setPreviousRevision(rev);
}
if (event != null) {
event.setURL(item.getURL());
wcAccess.handleEvent(event, ISVNEventHandler.UNKNOWN);
}
long cfRev = item.getCopyFromRevision().getNumber();//item.getCopyFromURL() != null ? rev : -1;
if (item.isDeleted()) {
try {
commitEditor.deleteEntry(commitPath, rev);