Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNURL


        myWCAccess = createWCAccess();
        targetWCPath = targetWCPath.getAbsoluteFile();
        try {
            SVNAdminArea adminArea = myWCAccess.probeOpen(targetWCPath, !dryRun, SVNWCAccess.INFINITE_DEPTH);
            SVNEntry targetEntry = myWCAccess.getVersionedEntry(targetWCPath, false);
            SVNURL url2 = srcURL == null ? getURL(srcPath) : srcURL;
            if (url2 == null) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL,
                        "''{0}'' has no URL", srcPath);
                SVNErrorManager.error(err, SVNLogType.WC);
            }
       
            SVNURL wcReposRoot = getReposRoot(targetWCPath, null, SVNRevision.WORKING, adminArea, myWCAccess);
            SVNRepository repository = null;
            SVNURL sourceReposRoot = null;
            try {
                repository = createRepository(wcReposRoot, null, null, true);
                sourceReposRoot = repository.getRepositoryRoot(true);
                if (!wcReposRoot.equals(sourceReposRoot)) {
                    Object source = srcPath;
View Full Code Here


        myHasExistingMergeInfo = false;
       
        boolean checkedMergeInfoCapability = false;
        for (int i = 0; i < mergeSources.size(); i++) {
            MergeSource mergeSource = (MergeSource) mergeSources.get(i);
            SVNURL url1 = mergeSource.myURL1;
            SVNURL url2 = mergeSource.myURL2;
            long revision1 = mergeSource.myRevision1;
            long revision2 = mergeSource.myRevision2;
            if (revision1 == revision2 && mergeSource.myURL1.equals(mergeSource.myURL2)) {
                continue;
            }
View Full Code Here

    }

    protected void doFileMerge(SVNURL url1, long revision1, SVNURL url2, long revision2,
            File targetWCPath, SVNAdminArea adminArea, boolean sourcesRelated) throws SVNException {
        boolean isRollBack = revision1 > revision2;
        SVNURL primaryURL = isRollBack ? url1 : url2;
        boolean honorMergeInfo = isHonorMergeInfo();
        boolean recordMergeInfo = isRecordMergeInfo();
        myIsSingleFileMerge = true;
        boolean[] indirect = { false };
        boolean[] isTreeConflict = { false };
        Map targetMergeInfo;
        Map implicitMergeInfo;
        SVNURL sourceRootURL = null;
        String mergeInfoPath = null;
        SVNMergeRange conflictedRange = null;
       
        myWCAccess.probeTry(targetWCPath, true, SVNWCAccess.INFINITE_DEPTH);
        SVNEntry entry = myWCAccess.getVersionedEntry(targetWCPath, false);

        if (honorMergeInfo) {
            sourceRootURL = myRepository1.getRepositoryRoot(true);
            mergeInfoPath = getPathRelativeToRoot(null, primaryURL, sourceRootURL, null, null);           
        }
        SVNMergeRange range = new SVNMergeRange(revision1, revision2, true);

        Object[] mergeInfoBundle = calculateRemainingRangeList(targetWCPath, entry, sourceRootURL, indirect,
                url1, revision1, url2, revision2, range);
        SVNMergeRangeList remainingRangeList = (SVNMergeRangeList) mergeInfoBundle[0];
        targetMergeInfo = (Map) mergeInfoBundle[1];
        implicitMergeInfo = (Map) mergeInfoBundle[1];

        SVNMergeRange[] remainingRanges = remainingRangeList.getRanges();
        AbstractDiffCallback callback = getMergeCallback(adminArea);

        String targetName = targetWCPath.getName();
        if (!myIsRecordOnly) {
            SVNMergeRangeList rangeListToMerge = remainingRangeList;
            if (myAreSourcesAncestral && remainingRangeList.getSize() > 1) {
                SVNURL oldSessionURL = ensureSessionURL(myRepository1, primaryURL);
                rangeListToMerge = removeNoOpMergeRanges(myRepository1, remainingRangeList);
                if (oldSessionURL != null) {
                    myRepository1.setLocation(oldSessionURL, false);
                }
            }
View Full Code Here

    protected void doDirectoryMerge(SVNURL url1, long revision1, SVNURL url2, long revision2,
        SVNEntry parentEntry, SVNAdminArea adminArea, SVNDepth depth) throws SVNException {
        File targetWCPath = adminArea.getRoot();
      boolean isRollBack = revision1 > revision2;
      SVNURL primaryURL = isRollBack ? url1 : url2;
      boolean honorMergeInfo = isHonorMergeInfo();
      boolean recordMergeInfo = isRecordMergeInfo();
      boolean sameURLs = url1.equals(url2);

      SVNMergeCallback mergeCallback = getMergeCallback(adminArea);
     
      myChildrenWithMergeInfo = new LinkedList();
      if (!(myAreSourcesAncestral && myIsSameRepository)) {
        if (myAreSourcesAncestral) {
          MergePath item = new MergePath(targetWCPath);
          SVNMergeRange itemRange = new SVNMergeRange(revision1, revision2, true);
          item.myRemainingRanges = new SVNMergeRangeList(itemRange);
          myChildrenWithMergeInfo.add(item);
        }
        driveMergeReportEditor(targetWCPath, url1, revision1, url2, revision2, null, isRollBack,
            depth, adminArea, mergeCallback, null);
        return;
      }
     
      SVNRepository repository = isRollBack ? myRepository1 : myRepository2;
      SVNURL sourceRootURL = repository.getRepositoryRoot(true);
      String mergeInfoPath = getPathRelativeToRoot(null, primaryURL, sourceRootURL, null, null);
      myChildrenWithMergeInfo = getMergeInfoPaths(myChildrenWithMergeInfo, mergeInfoPath, parentEntry,
          sourceRootURL, revision1, revision2, honorMergeInfo, repository, depth);

      MergePath targetMergePath = (MergePath) myChildrenWithMergeInfo.get(0);
        myIsTargetMissingChild = targetMergePath.myHasMissingChildren;
        boolean inheritable = !myIsTargetMissingChild && (depth == SVNDepth.INFINITY ||  depth == SVNDepth.IMMEDIATES);
       
        populateRemainingRanges(myChildrenWithMergeInfo, sourceRootURL, url1, revision1, url2, revision2,
            inheritable, honorMergeInfo, repository);
       
        SVNMergeRange range = new SVNMergeRange(revision1, revision2, inheritable);
        SVNRemoteDiffEditor editor = null;
        SVNErrorMessage err = null;
        if (honorMergeInfo && !myIsRecordOnly) {
          long startRev = getMostInclusiveStartRevision(myChildrenWithMergeInfo, isRollBack);
          if (SVNRevision.isValidRevisionNumber(startRev)) {
            range.setStartRevision(startRev);
                long endRev = getMostInclusiveEndRevision(myChildrenWithMergeInfo, isRollBack);
                while (SVNRevision.isValidRevisionNumber(endRev)) {
                    SVNURL realURL1 = url1;
                    SVNURL realURL2 = url2;
                    SVNURL oldURL1 = null;
                    SVNURL oldURL2 = null;
                    long nextEndRev = SVNRepository.INVALID_REVISION;
                   
                    sliceRemainingRanges(myChildrenWithMergeInfo, isRollBack, endRev);
                    myCurrentAncestorIndex = -1;
                    if (!sameURLs) {
View Full Code Here

                // skip mergeinfo from foreign repository
            } else if (!SVNProperty.MERGE_INFO.equals(propName) || propValue == null ||
                    "".equals(propValue.getString())) {
                adjustedProperties.put(propName, propValue);
            } else {
                SVNURL mergeSourceRootURL = myRepository2.getRepositoryRoot(true);
                SVNURL targetURL = getURL(path);
                SVNURL oldURL = ensureSessionURL(myRepository2, targetURL);
               
                Map filteredYoungerMergeInfo = null;
                Map mergeInfo = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(propValue.getString()), null);
               
                Map[] mergeInfoArr = { mergeInfo };
                Map youngerMergeInfo = splitMergeInfoOnRevision(mergeInfoArr, targetEntry.getRevision());
                mergeInfo = mergeInfoArr[0];
               
                if (youngerMergeInfo != null) {
                    for (Iterator youngerMergeInfoIter = youngerMergeInfo.keySet().iterator(); youngerMergeInfoIter.hasNext();) {
                        String sourcePath = (String) youngerMergeInfoIter.next();
                        SVNMergeRangeList rangeList = (SVNMergeRangeList) youngerMergeInfo.get(sourcePath);
                        SVNMergeRange ranges[] = rangeList.getRanges();
                        LinkedList adjustedRanges = new LinkedList();
                        SVNURL mergeSourceURL = mergeSourceRootURL.appendPath(sourcePath, false);
                        for (int i = 0; i < ranges.length; i++) {
                            SVNMergeRange range = ranges[i];
                            SVNRepositoryLocation[] locations = null;
                            try {
                                locations = getLocations(targetURL, null, myRepository2,
                                        SVNRevision.create(targetEntry.getRevision()),
                                        SVNRevision.create(range.getStartRevision() + 1), SVNRevision.UNDEFINED);
                                SVNURL startURL = locations[0].getURL();
                                if (!mergeSourceURL.equals(startURL)) {
                                    adjustedRanges.add(range);
                                }
                            } catch (SVNException svne) {
                                SVNErrorCode code = svne.getErrorMessage().getErrorCode();
View Full Code Here

            SVNConflictReason reason) throws SVNException {
        if (myIsRecordOnly || myIsDryRun) {
            return;
        }
       
        SVNURL srcReposRoot = myRepository1.getRepositoryRoot(true);
        String child = SVNPathUtil.getRelativePath(myTarget.getAbsolutePath(), victim.getAbsolutePath());
        SVNURL leftURL = null;
        SVNURL rightURL = null;
        if (child != null) {
            leftURL = myCurrentMergeSource.myURL1.appendPath(child, false);
            rightURL = myCurrentMergeSource.myURL2.appendPath(child, false);
        } else {
            leftURL = myCurrentMergeSource.myURL1;
View Full Code Here

                SVNEntry pathEntry = myWCAccess.getVersionedEntry(pathWithNewMergeInfo, false);
                boolean[] indirect = { false };
                Map pathExplicitMergeInfo = getWCMergeInfo(pathWithNewMergeInfo, pathEntry, null, SVNMergeInfoInheritance.EXPLICIT, false,
                        indirect);
               
                SVNURL oldURL = null;
                if (pathExplicitMergeInfo != null) {
                    oldURL = ensureSessionURL(myRepository2, pathEntry.getSVNURL());
                    Map pathInheritedMergeInfo = getWCOrRepositoryMergeInfo(pathWithNewMergeInfo, pathEntry,
                            SVNMergeInfoInheritance.NEAREST_ANCESTOR, indirect, false, myRepository2);
                   
View Full Code Here

                        SVNErrorManager.error(err, SVNLogType.DEFAULT);
                    }
                   
                    SVNDirEntry dirEntry = repository.info(path, mergeRange.getEndRevision());
                    if (mergeRangeContainsRevision(mergeRange, dirEntry.getRevision())) {
                        SVNURL fullURL = repository.getLocation();
                        if (path.startsWith("/")) {
                            path = path.substring(1);
                        }
                        fullURL = fullURL.appendPath(path, false);
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_NOT_READY_TO_MERGE,
                        "At least one revision (r{0}) not yet merged from ''{1}''",
                        new Object[] { new Long(dirEntry.getRevision()), fullURL });
                        SVNErrorManager.error(err, SVNLogType.DEFAULT);
                    }
View Full Code Here

        Map unmergedCatalog = findUnmergedMergeInfo(neverSynched, youngestMergedRev, mergeInfoCatalog, segmentsMap, sourceReposRelPath,
                targetReposRelPath, targetRev, sourceRev, repository);
        unmergedCatalog = SVNMergeInfoUtil.elideMergeInfoCatalog(unmergedCatalog);
       
        if (neverSynched[0]) {
            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();
View Full Code Here

   
    private void mergeCousinsAndSupplementMergeInfo(File targetWCPath, SVNEntry entry,
        SVNAdminArea adminArea, SVNRepository repository, SVNURL url1, long rev1, SVNURL url2,
        long rev2, long youngestCommonRev, SVNURL sourceReposRoot, SVNURL wcReposRoot, SVNDepth depth,
        boolean ignoreAncestry,  boolean force, boolean recordOnly, boolean dryRun) throws SVNException {
    SVNURL oldURL = repository.getLocation();
    List addSources = null;
    List removeSources = null;
    try {
      SVNRevision sRev = SVNRevision.create(rev1);
      SVNRevision eRev = SVNRevision.create(youngestCommonRev);
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.