Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNURL


        }
        super.addDeletedPath(path, nodeKind, type, action, expectedAction, false);
    }

    public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException {
        SVNURL url = getSourceURL(path);
        SVNURL expectedTargetURL = getTargetURL(path);
        long targetRevision = getTargetRevision(path);
        SVNURL[] mergeURLs = getMergeCallback().getTrueMergeTargets(url, Math.max(myRevision1, myRevision2), myRevision1, myRevision2, expectedTargetURL, targetRevision, SVNEditorAction.ADD);

        if (mergeURLs == null) {
            super.addFile(path, copyFromPath, copyFromRevision);
            return;
        }

        for (int i = 0; i < mergeURLs.length; i++) {
            SVNURL targetURL = mergeURLs[i];
            String targetPath = getPath(targetURL);
            File target = getFile(targetPath);


            if (!expectedTargetURL.equals(targetURL)) {
View Full Code Here


            }
        }
    }

    public void openFile(String path, long revision) throws SVNException {
        SVNURL url = getSourceURL(path);
        SVNURL expectedTargetURL = getTargetURL(path);
        long targetRevision = getTargetRevision(path);
        SVNURL[] mergeURLs = getMergeCallback().getTrueMergeTargets(url, Math.max(myRevision1, myRevision2), myRevision1, myRevision2, getTargetURL(path), targetRevision, SVNEditorAction.MODIFY);

        if (mergeURLs == null) {
            super.openFile(path, revision);
            return;
        }

        for (int i = 0; i < mergeURLs.length; i++) {
            SVNURL targetURL = mergeURLs[i];
            String targetPath = getPath(targetURL);
            File target = getFile(targetPath);

            if (!expectedTargetURL.equals(targetURL)) {
                boolean depthAllows = checkDepth(target, null, SVNNodeKind.FILE);
View Full Code Here

        } catch (SVNException e) {
            SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: Error while fetching copy source revision");
            return null;
        }

        SVNURL url = copySource.getURL();
        if (url == null) {
            url = getCopySourceURL(copySource);
            if (url == null) {
                return null;
            }
View Full Code Here

    public void open(SVNRepositoryImpl repository) throws SVNException {
        if (mySocket != null) {
            return;
        }
        SVNURL location = repository.getLocation();
        try {
            int connectTimeout = repository.getAuthenticationManager() != null ? repository.getAuthenticationManager().getConnectTimeout(repository) : DEFAULT_SVN_TIMEOUT;
            int readTimeout = repository.getAuthenticationManager() != null ? repository.getAuthenticationManager().getReadTimeout(repository) : DEFAULT_SVN_TIMEOUT;
            mySocket = SVNSocketFactory.createPlainSocket(location.getHost(), location.getPort(), connectTimeout, readTimeout, repository.getCanceller());
        } catch (SocketTimeoutException e) {
          SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_IO_ERROR, "timed out waiting for server", null, SVNErrorMessage.TYPE_ERROR, e);
            SVNErrorManager.error(err, e, SVNLogType.NETWORK);
        } catch (UnknownHostException e) {
          SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_IO_ERROR, "Unknown host " + e.getMessage(), null, SVNErrorMessage.TYPE_ERROR, e);
View Full Code Here

        /*
         * Same as 2. merge sourceWCPATH1@N sourceWCPATH2@M [WCPATH]
         * or      3. merge -r N:M SOURCE[@REV] [WCPATH]
         * where SOURCE is a path and path1 and path2 are the same.
         */
        SVNURL url1 = getURL(path1);
        if (url1 == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL",
                    path1);
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        SVNURL url2 = getURL(path2);
        if (url2 == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL",
                    path2);
            SVNErrorManager.error(err, SVNLogType.WC);
        }
View Full Code Here

     */
    public void doMerge(File path1, SVNRevision revision1, SVNURL url2, SVNRevision revision2, File dstPath,
            SVNDepth depth, boolean useAncestry, boolean force, boolean dryRun, boolean recordOnly) throws SVNException {
        path1 = path1.getAbsoluteFile();
        dstPath = dstPath.getAbsoluteFile();
        SVNURL url1 = getURL(path1);
        if (url1 == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL", path1);
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        runMerge(url1, revision1, url2, revision2, dstPath, depth, dryRun, force, !useAncestry,
View Full Code Here

     */
    public void doMerge(SVNURL url1, SVNRevision revision1, File path2, SVNRevision revision2, File dstPath,
            SVNDepth depth, boolean useAncestry, boolean force, boolean dryRun, boolean recordOnly) throws SVNException {
        path2 = path2.getAbsoluteFile();
        dstPath = dstPath.getAbsoluteFile();
        SVNURL url2 = getURL(path2);
        if (url2 == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL", path2);
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        runMerge(url1, revision1, url2, revision2, dstPath, depth, dryRun, force, !useAncestry,
View Full Code Here

     *                        for file:// URLs)                       
     *                        </ul>           
     * @since                 1.2, SVN 1.5
     */
    public Map doGetMergedMergeInfo(File path, SVNRevision pegRevision) throws SVNException {
      SVNURL reposRoot[] = new SVNURL[1];
      Map mergeInfo = getMergeInfo(path, pegRevision, reposRoot);
      SVNURL repositoryRoot = reposRoot[0];
      if (mergeInfo != null) {
        Map fullPathMergeInfo = new SVNHashMap();
            for (Iterator paths = mergeInfo.keySet().iterator(); paths.hasNext();) {
                String mergeSrcPath = (String) paths.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(mergeSrcPath);
                if (mergeSrcPath.startsWith("/")) {
                    mergeSrcPath = mergeSrcPath.substring(1);
                }
                SVNURL url = repositoryRoot.appendPath(mergeSrcPath, false);
                fullPathMergeInfo.put(url, rangeList);
            }
            mergeInfo = fullPathMergeInfo;
      }
      return mergeInfo;
View Full Code Here

     *                        for file:// URLs)                       
     *                        </ul>           
     * @since                 1.2, SVN 1.5
     */
    public Map doGetMergedMergeInfo(SVNURL url, SVNRevision pegRevision) throws SVNException {
      SVNURL reposRoot[] = new SVNURL[1];
      Map mergeInfo = getMergeInfo(url, pegRevision, reposRoot);
      SVNURL repositoryRoot = reposRoot[0];
      if (mergeInfo != null) {
        Map fullPathMergeInfo = new SVNHashMap();
            for (Iterator paths = mergeInfo.keySet().iterator(); paths.hasNext();) {
                String mergeSrcPath = (String) paths.next();
                SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(mergeSrcPath);
                if (mergeSrcPath.startsWith("/")) {
                    mergeSrcPath = mergeSrcPath.substring(1);
                }
                SVNURL nextURL = repositoryRoot.appendPath(mergeSrcPath, false);
                fullPathMergeInfo.put(nextURL, rangeList);
            }
            mergeInfo = fullPathMergeInfo;
      }
      return mergeInfo;
View Full Code Here

     * @return               potential merge sources for <code>path</code>
     * @since                1.2, SVN 1.5
     */
    public Collection doSuggestMergeSources(File path, SVNRevision pegRevision) throws SVNException {
        LinkedList suggestions = new LinkedList();
        SVNURL reposRoot = getReposRoot(path, null, pegRevision, null, null);
        SVNLocationEntry copyFromInfo = getCopySource(path, null, pegRevision);
        String copyFromPath = copyFromInfo.getPath();
        SVNURL copyFromURL = null;
        if (copyFromPath != null) {
            String relCopyFromPath = copyFromPath.startsWith("/") ? copyFromPath.substring(1) : copyFromPath;
            copyFromURL = reposRoot.appendPath(relCopyFromPath, false);
            suggestions.add(copyFromURL);
        }
       
        Map mergeInfo = doGetMergedMergeInfo(path, pegRevision);
        if (mergeInfo != null) {
            for (Iterator mergeSrcURLs = mergeInfo.keySet().iterator(); mergeSrcURLs.hasNext();) {
                SVNURL mergeSrcURL = (SVNURL) mergeSrcURLs.next();
                if (copyFromURL == null || !copyFromURL.equals(mergeSrcURL)) {
                    suggestions.add(mergeSrcURL);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNURL

Copyright © 2018 www.massapicom. 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.