} else if (SVNProperty.isEntryProperty(propName)) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_PROPERTY_NAME,
"Property ''{0}'' is an entry property", propName);
SVNErrorManager.error(err, SVNLogType.WC);
}
final SVNRepository repos = createRepository(url, null, null, true);
long revNumber = SVNRepository.INVALID_REVISION;
try {
revNumber = getRevisionNumber(baseRevision, repos, null);
} catch (SVNException svne) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION,
"Setting property on non-local target ''{0}'' needs a base revision", url);
SVNErrorManager.error(err, SVNLogType.WC);
}
if (SVNProperty.EOL_STYLE.equals(propName) || SVNProperty.KEYWORDS.equals(propName) || SVNProperty.CHARSET.equals(propName)) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
"Setting property ''{0}'' on non-local target ''{1}'' is not supported",
new Object[]{propName, url});
SVNErrorManager.error(err, SVNLogType.WC);
}
SVNNodeKind kind = repos.checkPath("", revNumber);
if (kind == SVNNodeKind.NONE) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND,
"Path ''{0}'' does not exist in revision {1}",
new Object[]{ url.getPath(), new Long(revNumber) });
SVNErrorManager.error(err, SVNLogType.WC);
}
if (propValue != null && SVNProperty.isSVNProperty(propName)) {
final long baseRev = revNumber;
propValue = SVNPropertiesManager.validatePropertyValue(url.toString(), kind, propName, propValue,
skipChecks, getOptions(), new ISVNFileContentFetcher() {
Boolean isBinary = null;
public void fetchFileContent(OutputStream os) throws SVNException {
SVNProperties props = new SVNProperties();
repos.getFile("", baseRev, props, os);
setBinary(props);
}
public boolean fileIsBinary() throws SVNException {
if (isBinary == null) {
SVNProperties props = new SVNProperties();
repos.getFile("", baseRev, props, null);
setBinary(props);
}
return isBinary.booleanValue();
}
private void setBinary(SVNProperties props) {
String mimeType = props.getStringValue(SVNProperty.MIME_TYPE);
isBinary = Boolean.valueOf(SVNProperty.isBinaryMimeType(mimeType));
}
});
}
Collection commitItems = new ArrayList(2);
SVNCommitItem commitItem = new SVNCommitItem(null, url, null,
kind, SVNRevision.create(revNumber), SVNRevision.UNDEFINED,
false, false, true, false, false, false);
commitItems.add(commitItem);
commitMessage = getCommitHandler().getCommitMessage(commitMessage, (SVNCommitItem[]) commitItems.toArray(new SVNCommitItem[commitItems.size()]));
if (commitMessage == null) {
return SVNCommitInfo.NULL;
}
commitMessage = SVNCommitUtil.validateCommitMessage(commitMessage);
ISVNEditor commitEditor = repos.getCommitEditor(commitMessage, null, true, revisionProperties, null);
try {
commitEditor.openRoot(revNumber);
if (kind == SVNNodeKind.FILE) {
commitEditor.openFile("", revNumber);
commitEditor.changeFileProperty("", propName, propValue);