public boolean isFile() { return !isURL(); }
public boolean isFile() { return !isURL(); }
public boolean isFile() { return !isURL(); }
public SVNURL getURL() throws SVNException { if (isURL()) { return SVNURL.parseURIEncoded(myTarget); } return null; }
public SVNURL getURL() throws SVNException { if (isURL()) { return SVNURL.parseURIEncoded(myTarget); } return null; }
public SVNURL getURL() throws SVNException { if (isURL()) { return SVNURL.parseURIEncoded(myTarget); } return null; }
protected File getLocalRepository(int index) throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.isEmpty()) { targets.add(""); } if (targets.isEmpty() || index > targets.size() - 1 ) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Repository argument required"), SVNLogType.CLIENT); } SVNPath target = new SVNPath((String) targets.get(index)); if (target.isURL()) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "'" + target.getTarget() + "' is an URL when it should be a path"), SVNLogType.CLIENT); } return target.getFile(); }
public SVNPath(String target, boolean keepPegRevision, boolean parsePegRevision) throws SVNException { myTarget = target; if (parsePegRevision) { parsePegRevision(keepPegRevision); } myTarget = SVNPathUtil.canonicalizePath(myTarget); assertControlChars(isURL() ? SVNEncodingUtil.uriDecode(myTarget) : myTarget); }
public SVNPath(String target, boolean keepPegRevision, boolean parsePegRevision) throws SVNException { myTarget = target; if (parsePegRevision) { parsePegRevision(keepPegRevision); } myTarget = SVNPathUtil.canonicalizePath(myTarget); assertControlChars(isURL() ? SVNEncodingUtil.uriDecode(myTarget) : myTarget); }
protected File getLocalRepository(int index) throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.isEmpty()) { targets.add(""); } if (targets.isEmpty() || index > targets.size() - 1 ) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "Repository argument required"), SVNLogType.CLIENT); } SVNPath target = new SVNPath((String) targets.get(index)); if (target.isURL()) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_ARG_PARSING_ERROR, "'" + target.getTarget() + "' is an URL when it should be a path"), SVNLogType.CLIENT); } return target.getFile(); }
public SVNPath(String target, boolean keepPegRevision) throws SVNException { myTarget = target; parsePegRevision(keepPegRevision); myTarget = SVNPathUtil.canonicalizePath(myTarget); assertControlChars(isURL() ? SVNEncodingUtil.uriDecode(myTarget) : myTarget); }
public SVNPath(String target, boolean keepPegRevision) throws SVNException { myTarget = target; parsePegRevision(keepPegRevision); myTarget = SVNPathUtil.canonicalizePath(myTarget); assertControlChars(isURL() ? SVNEncodingUtil.uriDecode(myTarget) : myTarget); }
public SVNPath(String target, boolean hasPegRevision) throws SVNException { myTarget = target; myHasPegRevision = hasPegRevision; if (myHasPegRevision) { parsePegRevision(true); } else { parsePegRevision(false); } myTarget = SVNPathUtil.canonicalizePath(myTarget); assertControlChars(isURL() ? SVNEncodingUtil.uriDecode(myTarget) : myTarget); }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.isEmpty()) { targets.add(""); } SVNPath target = new SVNPath((String) targets.get(0)); if (target.isURL()) { target = new SVNPath(""); targets.add(0, ""); } String trailURL = (String) (targets.size() > 1 ? targets.get(1) : null); if (target.isFile()) { String id = SVNClientManager.newInstance().getWCClient().doGetWorkingCopyID(target.getFile(), trailURL, getSVNVersionEnvironment().isCommitted()); if (id != null) { getEnvironment().getOut().print(id); if (!getSVNVersionEnvironment().isNoNewLine()) { getEnvironment().getOut().println(); } } } }
public void run() throws SVNException { List targets = getEnvironment().combineTargets(null, false); if (targets.isEmpty()) { targets.add(""); } SVNPath target = new SVNPath((String) targets.get(0)); if (target.isURL()) { target = new SVNPath(""); targets.add(0, ""); } String trailURL = (String) (targets.size() > 1 ? targets.get(1) : null); if (target.isFile()) { String id = SVNClientManager.newInstance().getWCClient().doGetWorkingCopyID(target.getFile(), trailURL, getSVNVersionEnvironment().isCommitted()); if (id != null) { getEnvironment().getOut().print(id); if (!getSVNVersionEnvironment().isNoNewLine()) { getEnvironment().getOut().println(); } } } }
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()); } }
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; }