return options;
}
public void run() throws SVNException {
List targets = getSVNEnvironment().combineTargets(new ArrayList(), true);
SVNPath url = null;
SVNPath src = null;
if (targets.isEmpty()) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS,
"Repository URL required when importing"), SVNLogType.CLIENT);
} else if (targets.size() > 2) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
"Too many arguments to import command"), SVNLogType.CLIENT);
} else if (targets.size() == 1) {
src = new SVNPath("");
url = new SVNPath((String) targets.get(0));
} else {
src = new SVNPath((String) targets.get(0));
url = new SVNPath((String) targets.get(1));
}
if (!url.isURL()) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR,
"Invalid URL ''{0}''", url.getTarget()), SVNLogType.CLIENT);
}
SVNCommitClient client = getSVNEnvironment().getClientManager().getCommitClient();
if (!getSVNEnvironment().isQuiet()) {
client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
}
SVNDepth depth = getSVNEnvironment().getDepth();
if (depth == SVNDepth.UNKNOWN) {
depth = SVNDepth.INFINITY;
}
client.setCommitHandler(getSVNEnvironment());
SVNCommitInfo info = client.doImport(src.getFile(), url.getURL(), getSVNEnvironment().getMessage(),
getSVNEnvironment().getRevisionProperties(), !getSVNEnvironment().isNoIgnore(),
getSVNEnvironment().isForce(), depth);
getSVNEnvironment().printCommitInfo(info);
}