SVNRevision revision = parseRevision(getCommandLine());
if (!revision.isValid()) {
revision = SVNRevision.HEAD;
}
getClientManager().setEventHandler(new SVNCommandEventProcessor(out, err, false, false));
SVNUpdateClient updater = getClientManager().getUpdateClient();
try {
SVNURL switchURL = SVNURL.parseURIEncoded(url);
if (getCommandLine().hasArgument(SVNArgument.RELOCATE)) {
SVNURL targetURL = SVNURL.parseURIEncoded(getCommandLine().getURL(1));
File file = new File(absolutePath).getAbsoluteFile();
file = new File(SVNPathUtil.validateFilePath(file.getAbsolutePath()));
updater.doRelocate(file, switchURL, targetURL, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
} else {
File file = new File(absolutePath).getAbsoluteFile();
file = new File(SVNPathUtil.validateFilePath(file.getAbsolutePath()));
updater.getDebugLog().info("switching path: " + file);
updater.doSwitch(file, switchURL, revision, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
}
} catch (Throwable th) {
updater.getDebugLog().info(th);
println(err, th.getMessage());
println(err);
System.exit(1);
}
}