SVNPath target = new SVNPath(targetName); if (target.isURL()) { urls.add(target.getURL()); } else { paths.add(target.getFile());
SVNPath target = new SVNPath(targetName); if (target.isURL()) { urls.add(target.getURL()); } else { paths.add(target.getFile());
SVNPath target = targets.size() == 2 ? new SVNPath((String) targets.get(1)) : new SVNPath(""); SVNPath to = new SVNPath((String) targets.get(0)); client.doRelocate(target.getFile(), null, to.getURL(), getSVNEnvironment().getDepth().isRecursive()); } else { if (targets.get(0).equals(targets.get(1))) { client.doRelocate(target.getFile(), from.getURL(), to.getURL(), getSVNEnvironment().getDepth().isRecursive()); } else { for(int i = 2; i < targets.size(); i++) { SVNPath target = new SVNPath((String) targets.get(i)); client.doRelocate(target.getFile(), from.getURL(), to.getURL(), getSVNEnvironment().getDepth().isRecursive());
SVNPath target = targets.size() == 2 ? new SVNPath((String) targets.get(1)) : new SVNPath(""); SVNPath to = new SVNPath((String) targets.get(0)); client.doRelocate(target.getFile(), null, to.getURL(), getSVNEnvironment().getDepth().isRecursive()); } else { if (targets.get(0).equals(targets.get(1))) { client.doRelocate(target.getFile(), from.getURL(), to.getURL(), getSVNEnvironment().getDepth().isRecursive()); } else { for(int i = 2; i < targets.size(); i++) { SVNPath target = new SVNPath((String) targets.get(i)); client.doRelocate(target.getFile(), from.getURL(), to.getURL(), getSVNEnvironment().getDepth().isRecursive());
SVNPath target = new SVNPath(targetName); if (target.isURL()) { urls.add(target.getURL()); } else { paths.add(target.getFile());
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.size() < 2) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS); SVNErrorManager.error(err, SVNLogType.CLIENT); } if (targets.size() > 2) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath toURL = new SVNPath((String) targets.get(0)); if (!toURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", toURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath fromURL = new SVNPath((String) targets.get(1)); if (!fromURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", fromURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); client.setEventHandler(this); client.doInitialize(fromURL.getURL(), toURL.getURL()); }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.size() < 2) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS); SVNErrorManager.error(err, SVNLogType.CLIENT); } if (targets.size() > 2) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath toURL = new SVNPath((String) targets.get(0)); if (!toURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", toURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath fromURL = new SVNPath((String) targets.get(1)); if (!fromURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", fromURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); client.setEventHandler(this); client.doInitialize(fromURL.getURL(), toURL.getURL()); }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.size() < 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS); SVNErrorManager.error(err, SVNLogType.CLIENT); } if (targets.size() > 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath toURL = new SVNPath((String) targets.get(0)); if (!toURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", toURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); client.setEventHandler(this); client.setReplayHandler(new ISVNLogEntryHandler() { public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { getEnvironment().getOut().println("Committed revision " + logEntry.getRevision() + "."); } }); client.doSynchronize(toURL.getURL()); }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.size() < 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS); SVNErrorManager.error(err, SVNLogType.CLIENT); } if (targets.size() > 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath toURL = new SVNPath((String) targets.get(0)); if (!toURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", toURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); client.setEventHandler(this); client.setReplayHandler(new ISVNLogEntryHandler() { public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { getEnvironment().getOut().println("Committed revision " + logEntry.getRevision() + "."); } }); client.doSynchronize(toURL.getURL()); }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.size() < 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS); SVNErrorManager.error(err, SVNLogType.CLIENT); } if (targets.size() > 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath toURL = new SVNPath((String) targets.get(0)); if (!toURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", toURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); SVNSyncInfo info = client.doInfo(toURL.getURL()); getSVNSyncEnvironment().getOut().println("Source URL: " + info.getSrcURL()); if (info.getSourceRepositoryUUID() != null) { getSVNSyncEnvironment().getOut().println("Source Repository UUID: " + info.getSourceRepositoryUUID()); } if (SVNRevision.isValidRevisionNumber(info.getLastMergedRevision())) { getSVNSyncEnvironment().getOut().println("Last Merged Revision: " + info.getLastMergedRevision()); } }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.size() < 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS); SVNErrorManager.error(err, SVNLogType.CLIENT); } if (targets.size() > 1) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNPath toURL = new SVNPath((String) targets.get(0)); if (!toURL.isURL()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Path ''{0}'' is not a URL", toURL.getTarget()); SVNErrorManager.error(err, SVNLogType.CLIENT); } SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); SVNSyncInfo info = client.doInfo(toURL.getURL()); getSVNSyncEnvironment().getOut().println("Source URL: " + info.getSrcURL()); if (info.getSourceRepositoryUUID() != null) { getSVNSyncEnvironment().getOut().println("Source Repository UUID: " + info.getSourceRepositoryUUID()); } if (SVNRevision.isValidRevisionNumber(info.getLastMergedRevision())) { getSVNSyncEnvironment().getOut().println("Last Merged Revision: " + info.getLastMergedRevision()); } }
SVNCommitInfo info = client.doImport(src.getFile(), url.getURL(), getSVNEnvironment().getMessage(), getSVNEnvironment().getRevisionProperties(), !getSVNEnvironment().isNoIgnore(), getSVNEnvironment().isForce(), depth, !getSVNEnvironment().isNoAutoProps());
SVNCommitInfo info = client.doImport(src.getFile(), url.getURL(), getSVNEnvironment().getMessage(), getSVNEnvironment().getRevisionProperties(), !getSVNEnvironment().isNoIgnore(), getSVNEnvironment().isForce(), depth, !getSVNEnvironment().isNoAutoProps());
client.doExport(from.getFile(), dst.getFile(), pegRevision, revision, eol, getSVNEnvironment().isForce(), depth); } else { client.doExport(from.getURL(), dst.getFile(), pegRevision, revision, eol, getSVNEnvironment().isForce(), depth);
private SVNURL checkRootURLOfTarget(SVNURL rootURL, String target) throws SVNException { SVNPath svnPath = new SVNPath(target, true); SVNWCClient client = getClientManager().getWCClient(); File path = svnPath.isFile() ? svnPath.getFile() : null; SVNURL url = svnPath.isURL() ? svnPath.getURL() : null; SVNURL tmpRootURL = null; try { tmpRootURL = client.getReposRoot(path, url, svnPath.getPegRevision()); } catch (SVNException svne) { SVNErrorMessage err = svne.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.ENTRY_NOT_FOUND || err.getErrorCode() == SVNErrorCode.WC_NOT_DIRECTORY) { return rootURL; } throw svne; } if (rootURL != null) { if (!rootURL.equals(tmpRootURL)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "All non-relative targets must have the same root URL"); SVNErrorManager.error(err, SVNLogType.CLIENT); } return rootURL; } return tmpRootURL; }
private SVNURL checkRootURLOfTarget(SVNURL rootURL, String target) throws SVNException { SVNPath svnPath = new SVNPath(target, true); SVNWCClient client = getClientManager().getWCClient(); File path = svnPath.isFile() ? svnPath.getFile() : null; SVNURL url = svnPath.isURL() ? svnPath.getURL() : null; SVNURL tmpRootURL = null; try { tmpRootURL = client.getReposRoot(path, url, svnPath.getPegRevision()); } catch (SVNException svne) { SVNErrorMessage err = svne.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.ENTRY_NOT_FOUND || err.getErrorCode() == SVNErrorCode.WC_NOT_DIRECTORY) { return rootURL; } throw svne; } if (rootURL != null) { if (!rootURL.equals(tmpRootURL)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "All non-relative targets must have the same root URL"); SVNErrorManager.error(err, SVNLogType.CLIENT); } return rootURL; } return tmpRootURL; }
try { if (target.isURL()) { client.doGetFileContents(target.getURL(), target.getPegRevision(), getSVNEnvironment().getStartRevision(), true, getSVNEnvironment().getOut()); } else { client.doGetFileContents(target.getFile(), target.getPegRevision(), getSVNEnvironment().getStartRevision(), true, getSVNEnvironment().getOut());
try { if (target.isURL()) { client.doGetFileContents(target.getURL(), target.getPegRevision(), getSVNEnvironment().getStartRevision(), true, getSVNEnvironment().getOut()); } else { client.doGetFileContents(target.getFile(), target.getPegRevision(), getSVNEnvironment().getStartRevision(), true, getSVNEnvironment().getOut());
private void doDiff(SVNDiffClient client, SVNLogEntry logEntry, SVNPath target, SVNDepth depth) throws SVNException { if (target.isFile()) { client.doDiff(target.getFile(), target.getPegRevision(), SVNRevision.create(logEntry.getRevision() - 1), SVNRevision.create(logEntry.getRevision()), depth, true, getSVNEnvironment().getOut(), getSVNEnvironment().getChangelistsCollection()); } else { client.doDiff(target.getURL(), target.getPegRevision(), SVNRevision.create(logEntry.getRevision() - 1), SVNRevision.create(logEntry.getRevision()), depth, true, getSVNEnvironment().getOut()); } }
private void doDiff(SVNDiffClient client, SVNLogEntry logEntry, SVNPath target, SVNDepth depth) throws SVNException { if (target.isFile()) { client.doDiff(target.getFile(), target.getPegRevision(), SVNRevision.create(logEntry.getRevision() - 1), SVNRevision.create(logEntry.getRevision()), depth, true, getSVNEnvironment().getOut(), getSVNEnvironment().getChangelistsCollection()); } else { client.doDiff(target.getURL(), target.getPegRevision(), SVNRevision.create(logEntry.getRevision() - 1), SVNRevision.create(logEntry.getRevision()), depth, true, getSVNEnvironment().getOut()); } }