Examples of SVNLocationEntry


Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        }
    }
   
    private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException {
        if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) {
            return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath);
        }
       
        if (node.myParent != null) {
            SVNLocationEntry location = findRealBaseLocation(node.myParent);
            return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName)));
        }

        return new SVNLocationEntry(-1, "/");
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

                            if (relPath.startsWith("/")) {
                                relPath = relPath.substring(1);
                            }
                            copyFromPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(logEntryPath.getCopyPath(), relPath));
                        }
                        myCopyFromLocation = new SVNLocationEntry(logEntryPath.getCopyRevision(), copyFromPath);
                        break;
                    }
                }
            }
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

    }

    protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException {
        long[] pegRev = { SVNRepository.INVALID_REVISION };
        SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev);
        SVNLocationEntry copyFromEntry = null;
        String targetPath = getPathRelativeToRoot(path, url, null, null, repos);
        CopyFromReceiver receiver = new CopyFromReceiver(targetPath);
            try {
                repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver);
                copyFromEntry = receiver.getCopyFromLocation();
            } catch (SVNException e) {
                SVNErrorCode errCode = e.getErrorMessage().getErrorCode();
                if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) {
                    return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null);
                }
                throw e;
            }

        return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null)
                                     : copyFromEntry;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

           
            boolean sameRepos = sourceReposRoot.equals(wcReposRoot);
            String youngestCommonPath = null;
            long youngestCommonRevision = SVNRepository.INVALID_REVISION;
            if (!ignoreAncestry) {
              SVNLocationEntry youngestLocation = getYoungestCommonAncestor(null, url1, rev1, null, url2,
                  rev2);
              youngestCommonPath = youngestLocation.getPath();
              youngestCommonRevision = youngestLocation.getRevision();
            }

            boolean related = false;
            boolean ancestral = false;
            List mergeSources = null;
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

                SVNURL[] url1 = { null };
               
                Map unmergedToSourceMergeInfoCatalog = calculateLeftHandSide(url1, rev1, targetReposRelPath,
                        handler.getSubTreesWithMergeInfoPaths(), rev1[0], sourceReposRelPath, sourceReposRoot, rev2, repository);
               
                SVNLocationEntry youngestCommonAncestor = getYoungestCommonAncestor(null, url2, rev2, null, url1[0],
                        rev1[0]);
               
                String youngestAncestorPath = youngestCommonAncestor.getPath();
                long youngestAncestorRevision = youngestCommonAncestor.getRevision();
                if (!(youngestAncestorPath != null && SVNRevision.isValidRevisionNumber(youngestAncestorRevision))) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_NOT_READY_TO_MERGE,
                            "''{0}@{1}'' must be ancestrally related to ''{2}@{3}''",
                            new Object[] { url1[0], new Long(rev1[0]), url2, new Long(rev2)});
                    SVNErrorManager.error(err, SVNLogType.WC);
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

        long[] youngestMergedRev = new long[1];
        SVNURL sourceURL = sourceReposRoot.appendPath(sourceReposRelPath.startsWith("/") ?
                sourceReposRelPath.substring(1) : sourceReposRelPath, false);
        SVNURL targetURL = sourceReposRoot.appendPath(targetReposRelPath.startsWith("/") ?
                targetReposRelPath.substring(1) : targetReposRelPath, false);
        SVNLocationEntry youngestLocation = getYoungestCommonAncestor(null, sourceURL, sourceRev, null,
                targetURL, targetRev);
        String youngestCommonAncestorPath = youngestLocation.getPath();
        leftRev[0] = youngestLocation.getRevision();
        if (!(youngestCommonAncestorPath != null && SVNRevision.isValidRevisionNumber(leftRev[0]))) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_NOT_READY_TO_MERGE,
                    "''{0}@{1}'' must be ancestrally related to ''{2}@{3}''",
                    new Object[] { sourceURL, new Long(sourceRev), targetURL, new Long(targetRev) });
            SVNErrorManager.error(err, SVNLogType.DEFAULT);
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

            trimRevision = segment.getStartRevision();
        } else if (segment.getPath() == null) {
            if (segments.size() > 1) {
                SVNLocationSegment segment2 = (SVNLocationSegment) segments.get(1);
                SVNURL segmentURL = sourceRootURL.appendPath(segment2.getPath(), false);
                SVNLocationEntry copyFromLocation = getCopySource(null, segmentURL,
                        SVNRevision.create(segment2.getStartRevision()));
                String copyFromPath = copyFromLocation.getPath();
                long copyFromRevision = copyFromLocation.getRevision();
                if (copyFromPath != null && SVNRevision.isValidRevisionNumber(copyFromRevision)) {
                    SVNLocationSegment newSegment = new SVNLocationSegment(copyFromRevision,
                            copyFromRevision, copyFromPath);
                    segment.setStartRevision(copyFromRevision + 1);
                    segments.addFirst(newSegment);
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

              youngestCommonPath = path;
            }
          }
        }
      }
      return new SVNLocationEntry(youngestCommonRevision, youngestCommonPath);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.SVNLocationEntry

                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.io.SVNLocationEntry

        if (pegPath == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "path ''{0}'' in revision {1} is an unrelated object", new Object[] {path, new Long(logStart)});
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        Map result = new SVNHashMap();
        result.put(new Long(startRevision), new SVNLocationEntry(-1, startPath));
        result.put(new Long(endRevision), new SVNLocationEntry(-1, endPath));
        return result;
    }
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.