private String checkout(SvnOperationFactory svnOperationFactory) throws SVNException { logger.debug("Checking out " + getUri() + " to: " + getWorkingDirectory().getAbsolutePath()); final SvnCheckout checkout = svnOperationFactory.createCheckout(); checkout.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(getUri()))); checkout.setSingleTarget(SvnTarget.fromFile(getWorkingDirectory())); Long id = checkout.run(); if (id == null) { return null; } return id.toString(); }
/** * Creates a target from URL * @param url target URL * @return a new <code>SvnTarget</code> object representing URL */ public static SvnTarget fromURL(SVNURL url) { return fromURL(url, SVNRevision.UNDEFINED); }
public void setToURL(SVNURL toURL) { this.toURL = toURL; setSingleTarget(toURL != null ? SvnTarget.fromURL(toURL) : null); } }
public void setToUrl(SVNURL toUrl) { this.toUrl = toUrl; setSingleTarget(toUrl != null ? SvnTarget.fromURL(toUrl) : null); } }
public void setToURL(SVNURL toURL) { this.toURL = toURL; setSingleTarget(toURL != null ? SvnTarget.fromURL(toURL) : null); }
public void setToURL(SVNURL toURL) { this.toURL = toURL; setSingleTarget(SvnTarget.fromURL(toURL)); }
private SvnTarget getTarget(String path, Revision revision) { SVNRevision svnRevision = getSVNRevision(revision); if (SVNPathUtil.isURL(path)) { try { return SvnTarget.fromURL(SVNURL.parseURIEncoded(path), svnRevision); } catch (SVNException e) { //never happens if SVNPathUtil#isURL works correctly throw new IllegalArgumentException(e); } } return SvnTarget.fromFile(new File(path), svnRevision); }
private long getRevisionNumber(SVNRevision revision1, SVNRepository repository1, SVNURL url1) throws SVNException { final Structure<SvnRepositoryAccess.RevisionsPair> revisionNumber = getRepositoryAccess().getRevisionNumber(repository1, SvnTarget.fromURL(url1, revision1), revision1, null); return revisionNumber.lng(SvnRepositoryAccess.RevisionsPair.revNumber); }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { getOperation().receive(SvnTarget.fromURL(dirEntry.getURL()), dirEntry); } }
public void handleAdminEvent(SVNAdminEvent event, double progress) throws SVNException { getOperation().receive(SvnTarget.fromURL(getOperation().getToURL()), event); } }
public void handleAdminEvent(SVNAdminEvent event, double progress) throws SVNException { getOperation().receive(SvnTarget.fromURL(getOperation().getFromURL()), event); } }
public void handleAdminEvent(SVNAdminEvent event, double progress) throws SVNException { getOperation().receive(SvnTarget.fromURL(getOperation().getToURL()), event); } }
@Override protected SVNCommitInfo run() throws SVNException { SVNCommitInfo info = doRun(); if (info != null) { Collection<SvnTarget> targets = getOperation().getTargets(); if (targets != null && targets.size() != 0) { SvnTarget firstTarget = targets.iterator().next(); SVNRepository repository = getRepositoryAccess().createRepository(firstTarget.getURL(), null, true); SVNURL repositoryRoot = repository.getRepositoryRoot(true); getOperation().receive(SvnTarget.fromURL(repositoryRoot), info); } } return info; }
public void handleProperty(SVNURL url, SVNPropertyData property) throws SVNException { if (getOperation().getPropertyReceiver() != null) { getOperation().getPropertyReceiver().receive(SvnTarget.fromURL(url), property); } }
public void handleDiffStatus(SVNDiffStatus diffStatus) throws SVNException { if (receiver != null) { final SvnTarget target = diffStatus.getURL() != null ? SvnTarget.fromURL(diffStatus.getURL()) : SvnTarget.fromFile(diffStatus.getFile()); receiver.receive(target, SvnCodec.diffStatus(diffStatus)); } } };
private SvnTarget getAbsoluteTarget(String path) { if (SVNPathUtil.isURL(path)) { try { return SvnTarget.fromURL(SVNURL.parseURIEncoded(path)); } catch (SVNException e) { return SvnTarget.fromFile(SVNFileUtil.createFilePath(path)); } } else { return SvnTarget.fromFile(SVNFileUtil.createFilePath(path)); } } }
private SVNURL reposLocations(SVNURL url, long pegRevision, SVNURL reposRootUrl, String reposUuid, long opRevision, SVNRepository svnRepository) throws SVNException { SVNURL oldUrl = SvnNgMergeDriver.ensureSessionURL(svnRepository, url); try { Structure<SvnRepositoryAccess.LocationsInfo> locations = repositoryAccess.getLocations(svnRepository, SvnTarget.fromURL(url), SVNRevision.create(pegRevision), SVNRevision.create(opRevision), SVNRevision.HEAD); SVNURL startUrl = locations.get(SvnRepositoryAccess.LocationsInfo.startUrl); return startUrl; } finally { svnRepository.setLocation(oldUrl, false); } }
public static SvnCopySource copySource(SVNCopySource oldSource) { SvnTarget target; if (oldSource.isURL()) { target = SvnTarget.fromURL(oldSource.getURL(), oldSource.getPegRevision()); } else { target = SvnTarget.fromFile(oldSource.getFile(), oldSource.getPegRevision()); } final SvnCopySource copySource = SvnCopySource.create(target, oldSource.getRevision()); copySource.setCopyContents(oldSource.isCopyContents()); return copySource; }
private void checkout(@NotNull String path, @NotNull SVNDepth depth) throws SVNException { final SvnCheckout checkout = factory.createCheckout(); checkout.setSource(SvnTarget.fromURL(server.getUrl().appendPath(path, true))); checkout.setSingleTarget(SvnTarget.fromFile(wc)); checkout.setRevision(SVNRevision.HEAD); checkout.setDepth(depth); checkout.run(); }
@Test public void checkoutRootRevision() throws Exception { try (SvnTestServer server = SvnTestServer.createEmpty()) { final SvnOperationFactory factory = server.createOperationFactory(); final SvnCheckout checkout = factory.createCheckout(); checkout.setSource(SvnTarget.fromURL(server.getUrl())); checkout.setSingleTarget(SvnTarget.fromFile(server.getTempDirectory())); checkout.setRevision(SVNRevision.create(0)); checkout.run(); } }