SVNErrorManager.error(err, SVNLogType.CLIENT);
}
SVNWCClient client = getSVNEnvironment().getClientManager().getWCClient();
for (Iterator ts = targets.iterator(); ts.hasNext();) {
String targetName = (String) ts.next();
SVNPath target = new SVNPath(targetName);
if (target.isFile()) {
if (getSVNEnvironment().getMessage() != null || getSVNEnvironment().getFileData() != null || getSVNEnvironment().getRevisionProperties() != null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_UNNECESSARY_LOG_MESSAGE,
"Local, non-commit operations do not take a log message or revision properties");
SVNErrorManager.error(err, SVNLogType.CLIENT);
}
SVNPropertyData property = client.doGetProperty(target.getFile(), propertyName,
SVNRevision.UNDEFINED, SVNRevision.WORKING);
SVNPropertyValue propertyValue = property != null ? property.getValue() : SVNPropertyValue.create("");
byte[] propBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue);
byte[] bytes = SVNCommandUtil.runEditor(getSVNEnvironment(), getSVNEnvironment().getEditorCommand(), propBytes, "svn-prop");
SVNPropertyValue newPropertyValue = SVNPropertyValue.create(propertyName, bytes);
if (newPropertyValue != null && !newPropertyValue.equals(propertyValue)) {
checkBooleanProperty(propertyName, newPropertyValue);
client.doSetProperty(target.getFile(), propertyName, newPropertyValue,
getSVNEnvironment().isForce(), SVNDepth.EMPTY, this, null);
String message = "Set new value for property ''{0}'' on ''{1}''";
String path = SVNCommandUtil.getLocalPath(targetName);
message = MessageFormat.format(message, new Object[]{propertyName, path});
getSVNEnvironment().getOut().println(message);
} else {
String message = "No changes to property ''{0}'' on ''{1}''";
String path = SVNCommandUtil.getLocalPath(targetName);
message = MessageFormat.format(message, new Object[]{propertyName, path});
getSVNEnvironment().getOut().println(message);
}
} else {
SVNPropertyData property = client.doGetProperty(target.getURL(), propertyName,
SVNRevision.UNDEFINED, SVNRevision.HEAD);
SVNPropertyValue propertyValue = property != null ? property.getValue() : SVNPropertyValue.create("");
byte[] propBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue);
byte[] bytes = SVNCommandUtil.runEditor(getSVNEnvironment(), getSVNEnvironment().getEditorCommand(), propBytes, "svn-prop");
SVNPropertyValue newPropertyValue = SVNPropertyValue.create(propertyName, bytes);
if (newPropertyValue != null && !newPropertyValue.equals(propertyValue)) {
checkBooleanProperty(propertyName, newPropertyValue);
client.setCommitHandler(getSVNEnvironment());
SVNCommitInfo info = client.doSetProperty(target.getURL(), propertyName,
newPropertyValue, SVNRevision.HEAD, getSVNEnvironment().getMessage(),
getSVNEnvironment().getRevisionProperties(), getSVNEnvironment().isForce(),
this);
String message = "Set new value for property ''{0}'' on ''{1}''";
message = MessageFormat.format(message, new Object[]{propertyName, targetName});