Examples of SVNURL


Examples of org.tmatesoft.svn.core.SVNURL

        String url = myDst.getCanonicalFile().toURI().toURL().toExternalForm();

        url = url.replaceFirst("file:/", "file://localhost/");

        // Have to decode the URL ...
        SVNURL encodedUrl = SVNURL.parseURIEncoded(url);
        url = encodedUrl.toDecodedString();

        if (!url.endsWith("/")) url = url + "/";
        return url;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

        this.url = url;
        this.destinationDirectory = destinationDirectory;
    }

    public void export() throws SVNException {
        SVNURL url = SVNURL.parseURIEncoded(this.url);
        String userName = "guest";
        String userPassword = "guest";

        /*
         * Prepare filesystem directory (export destination).
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

     * @throws SVNException
     * @since                 1.2.0        
     */
    public SVNURL getReposRoot(File path, SVNURL url, SVNRevision pegRevision, SVNAdminArea adminArea,
            SVNWCAccess access) throws SVNException {
        SVNURL reposRoot = null;
        if (path != null && (pegRevision == SVNRevision.WORKING || pegRevision == SVNRevision.BASE)) {
            if (access == null) {
                access = createWCAccess();
            }
           
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

    }

    protected SVNRepository createRepository(SVNURL url, File path, SVNAdminArea area, SVNRevision pegRevision,
            SVNRevision revision, long[] pegRev) throws SVNException {
        if (url == null) {
            SVNURL pathURL = getURL(path);
            if (pathURL == null) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL,
                        "''{0}'' has no URL", path);
                SVNErrorManager.error(err, SVNLogType.WC);
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

        }
    }

    protected Map getReposMergeInfo(SVNRepository repository, String path, long revision,
        SVNMergeInfoInheritance inheritance, boolean squelchIncapable) throws SVNException {
      SVNURL oldURL = ensureSessionURL(repository, null);
      Map reposMergeInfo = null;
      try {
        reposMergeInfo = repository.getMergeInfo(new String[] { path }, revision, inheritance, false);
      } catch (SVNException svne) {
        if (!squelchIncapable || svne.getErrorMessage().getErrorCode() != SVNErrorCode.UNSUPPORTED_FEATURE) {
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

    protected Map getWCOrRepositoryMergeInfo(File path, SVNEntry entry,
            SVNMergeInfoInheritance inherit, boolean[] indirect, boolean reposOnly,
            SVNRepository repository) throws SVNException {
        Map mergeInfo = null;
        long targetRev[] = { -1 };
        SVNURL url = getEntryLocation(path, entry, targetRev, SVNRevision.WORKING);
        long revision = targetRev[0];

        if (!reposOnly) {
            mergeInfo = getWCMergeInfo(path, entry, null, inherit, false, indirect);
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

                wcAccess.close();
            }
        }
        String repoPath = "";
        Map locations = null;
        SVNURL rootURL = null;

        if (repository == null) {
            repository = createRepository(url, null, null, true);
        } else {
            // path relative to repository location.
            repoPath = SVNPathUtil.getPathAsChild(repository.getLocation().toString(), url.toString());
            if (repoPath == null) {
                repoPath = "";
            }
        }

        if (pegRevisionNumber < 0) {
            pegRevisionNumber = getRevisionNumber(revision, youngestRevNumber, repository, path);
        }

        if (revision == start && revision == SVNRevision.HEAD) {
            startRevisionNumber = pegRevisionNumber;
        } else {
            startRevisionNumber = getRevisionNumber(start, youngestRevNumber, repository, path);
        }

        if (!end.isValid()) {
            endRevisionNumber = startRevisionNumber;
        } else {
            endRevisionNumber = getRevisionNumber(end, youngestRevNumber, repository, path);
        }

        if (endRevisionNumber == pegRevisionNumber && startRevisionNumber == pegRevisionNumber) {
            SVNRepositoryLocation[] result = new SVNRepositoryLocation[2];
            result[0] = new SVNRepositoryLocation(url, startRevisionNumber);
            result[1] = new SVNRepositoryLocation(url, endRevisionNumber);
            return result;
        }

        rootURL = repository.getRepositoryRoot(true);
        long[] revisionsRange = startRevisionNumber == endRevisionNumber ? new long[] { startRevisionNumber } :
            new long[] {startRevisionNumber, endRevisionNumber};

        try {
            locations = repository.getLocations(repoPath, (Map) null, pegRevisionNumber, revisionsRange);
        } catch (SVNException e) {
            if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_NOT_IMPLEMENTED) {
                locations = getLocations10(repository, pegRevisionNumber, startRevisionNumber, endRevisionNumber);
            } else {
                throw e;
            }
        }

        // try to get locations with 'log' method.
        SVNLocationEntry startPath = (SVNLocationEntry) locations.get(new Long(startRevisionNumber));
        SVNLocationEntry endPath = (SVNLocationEntry) locations.get(new Long(endRevisionNumber));
       
        if (startPath == null) {
            Object source = path != null ? (Object) path : (Object) url;
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_UNRELATED_RESOURCES, "Unable to find repository location for ''{0}'' in revision ''{1}''", new Object[] {source, new Long(startRevisionNumber)});
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        if (endPath == null) {
            Object source = path != null ? (Object) path : (Object) url;
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_UNRELATED_RESOURCES, "The location for ''{0}'' for revision {1} does not exist in the " +
                    "repository or refers to an unrelated object", new Object[] {source, new Long(endRevisionNumber)});
            SVNErrorManager.error(err, SVNLogType.WC);
        }
       
        SVNRepositoryLocation[] result = new SVNRepositoryLocation[2];
        SVNURL startURL = SVNURL.parseURIEncoded(SVNPathUtil.append(rootURL.toString(), SVNEncodingUtil.uriEncode(startPath.getPath())));
        result[0] = new SVNRepositoryLocation(startURL, startRevisionNumber);
        if (end.isValid()) {
            SVNURL endURL = SVNURL.parseURIEncoded(SVNPathUtil.append(rootURL.toString(), SVNEncodingUtil.uriEncode(endPath.getPath())));
            result[1] = new SVNRepositoryLocation(endURL, endRevisionNumber);
        }
        return result;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

        }
        return url;
    }
   
    protected SVNURL getEntryLocation(File path, SVNEntry entry, long[] revNum, SVNRevision pegRevision) throws SVNException {
        SVNURL url = null;
        if (entry.getCopyFromURL() != null && pegRevision == SVNRevision.WORKING) {
            url = entry.getCopyFromSVNURL();
            if (revNum != null && revNum.length > 0) {
                revNum[0] = entry.getCopyFromRevision();
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

        }
        return url;
    }
   
    protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException {
      SVNURL oldURL = repository.getLocation();
      if (url == null) {
        url = repository.getRepositoryRoot(true);
      }
      if (!url.equals(oldURL)) {
        repository.setLocation(url, false);
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNURL

    FSRepositoryFactory.setup();
  }

  public SVNRepository setupConnection(ConfigurationData configuration) throws SVNException {
    String svnUriString = configuration.getSubElement("uri").getSelfValue();
    SVNURL svnurl;
    // this is a hack for SVNKit to work with some unit tests because it does no like ".." in a path or Java's URI objects
    if ("demorepo".equals(svnUriString)) {
      svnurl = SVNURL.fromFile(new File(new File(System.getProperty("user.dir")).getParentFile(), "demorepo"));
    } else {
      svnurl = SVNURL.parseURIEncoded(svnUriString);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.