Examples of ISVNMerger


Examples of org.exist.versioning.svn.wc.ISVNMerger

                   
                byte[] conflictStart = ("<<<<<<< " + conflictWorking).getBytes();
                byte[] conflictEnd = (">>>>>>> " + conflictNew).getBytes();
                byte[] separator = ("=======").getBytes();

                ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
                SVNDiffConflictChoiceStyle style = conflictChoice == SVNConflictChoice.THEIRS_CONFLICT ? SVNDiffConflictChoiceStyle.CHOOSE_LATEST :
                    SVNDiffConflictChoiceStyle.CHOOSE_MODIFIED;
                if (merger instanceof DefaultSVNMerger) {
                    DefaultSVNMerger defaultMerger = (DefaultSVNMerger) merger;
                    defaultMerger.setDiffConflictStyle(style);
                }
               
                autoResolveSourceFile = SVNAdminUtil.createTmpFile(this);

                SVNMergeFileSet mergeFileSet = new SVNMergeFileSet(this, null, conflictOldFile, conflictWorkingFile, name, conflictNewFile,
                        autoResolveSourceFile, null, null);

                String localLabel = ".working";
                String baseLabel = ".old";
                String latestLabel = ".new";
               
                mergeFileSet.setMergeLabels(baseLabel, localLabel, latestLabel);
                merger.mergeText(mergeFileSet, false, null);
                mergeFileSet.dispose();
                removeSource = true;
            }
        } else if (conflictChoice != SVNConflictChoice.MERGED) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.INCORRECT_PARAMS, "Invalid 'conflict_result' argument");
View Full Code Here

Examples of org.exist.versioning.svn.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
       
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
        propDiff = propDiff == null ? new SVNProperties() : propDiff;

        SVNMergeResult result = merger.mergeProperties(name, workingProps, baseProps, serverBaseProps,
                propDiff, this, log, baseMerge, dryRun);

        return result.getMergeStatus();
    }
View Full Code Here

Examples of org.exist.versioning.svn.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);

        String workingText = localPath;
        if (copyFromText != null) {
            String copyFromTextPath = copyFromText.getAbsolutePath().replace(File.separatorChar, '/');
            String thisPath = getRoot().getAbsolutePath().replace(File.separatorChar, '/');
            workingText = copyFromTextPath.substring(thisPath.length());
            if (workingText.startsWith("/")) {
                workingText = workingText.substring(1);
            }
        }
       
        File tmpTarget = SVNTranslator.detranslateWorkingCopy(this, workingText, propChanges, false);
        base = SVNTranslator.maybeUpdateTargetEOLs(this, base, propChanges);
        File resultFile = SVNAdminUtil.createTmpFile(this);

        SVNMergeFileSet mergeFileSet = new SVNMergeFileSet(this, log, base, tmpTarget, localPath, latest,
                resultFile, copyFromText, mimeType);

        mergeFileSet.setMergeLabels(baseLabel, localLabel, latestLabel);

      SVNMergeResult mergeResult;
      try {
          mergeResult = merger.mergeText(mergeFileSet, dryRun, options);
      }
      finally {
        if (dryRun) {
            SVNFileUtil.deleteFile(resultFile);
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
       
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
        propDiff = propDiff == null ? new SVNProperties() : propDiff;

        SVNMergeResult result = merger.mergeProperties(name, workingProps, baseProps, serverBaseProps,
                propDiff, this, log, baseMerge, dryRun);

        return result.getMergeStatus();
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);

        String workingText = localPath;
        if (copyFromText != null) {
            String copyFromTextPath = copyFromText.getAbsolutePath().replace(File.separatorChar, '/');
            String thisPath = getRoot().getAbsolutePath().replace(File.separatorChar, '/');
            workingText = copyFromTextPath.substring(thisPath.length());
            if (workingText.startsWith("/")) {
                workingText = workingText.substring(1);
            }
        }
       
        File tmpTarget = SVNTranslator.detranslateWorkingCopy(this, workingText, propChanges, false);
        base = SVNTranslator.maybeUpdateTargetEOLs(this, base, propChanges);
        File resultFile = SVNAdminUtil.createTmpFile(this);

        SVNMergeFileSet mergeFileSet = new SVNMergeFileSet(this, log, base, tmpTarget, localPath, latest,
                resultFile, copyFromText, mimeType);

        mergeFileSet.setMergeLabels(baseLabel, localLabel, latestLabel);

      SVNMergeResult mergeResult;
      try {
          mergeResult = merger.mergeText(mergeFileSet, dryRun, options);
      }
      finally {
        if (dryRun) {
            SVNFileUtil.deleteFile(resultFile);
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

       
        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
        boolean customMerger = merger.getClass() != DefaultSVNMerger.class;

        if (SVNProperty.isBinaryMimeType(mimeType) && !customMerger) {
            // binary
            if (!dryRun) {               
                File oldFile = SVNFileUtil.createUniqueFile(getRoot(), localPath, baseLabel);
                File newFile = SVNFileUtil.createUniqueFile(getRoot(), localPath, latestLabel);
                SVNFileUtil.copyFile(base, oldFile, false);
                SVNFileUtil.copyFile(latest, newFile, false);
                // update entry props
                entry.setConflictNew(SVNFileUtil.getBasePath(newFile));
                entry.setConflictOld(SVNFileUtil.getBasePath(oldFile));
                entry.setConflictWorking(null);
                saveEntries(false);
            }
            status = SVNStatusType.CONFLICTED;
        } else {
            // text
            // 1. destranslate local
            File localTmpFile = SVNFileUtil.createUniqueFile(getRoot(), localPath, ".tmp");
            SVNTranslator.translate(this, localPath, localPath, SVNFileUtil.getBasePath(localTmpFile), false);
            // 2. run merge between all files we have :)
            OutputStream result = null;
            File resultFile = dryRun ? null : SVNFileUtil.createUniqueFile(getRoot(), localPath, ".result");
           
            result = resultFile == null ? SVNFileUtil.DUMMY_OUT : SVNFileUtil.openFileForWriting(resultFile);
            try {
                status = SVNProperty.isBinaryMimeType(mimeType) ?
                        merger.mergeBinary(base, localTmpFile, latest, dryRun, result) :
                        merger.mergeText(base, localTmpFile, latest, dryRun, options, result);
            } finally {
                SVNFileUtil.closeFile(result);
            }
            if (dryRun) {
                localTmpFile.delete();
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
       
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
        propDiff = propDiff == null ? new SVNProperties() : propDiff;

        SVNMergeResult result = merger.mergeProperties(name, workingProps, baseProps, serverBaseProps,
                propDiff, this, log, baseMerge, dryRun);

        return result.getMergeStatus();
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);

        String workingText = localPath;
        if (copyFromText != null) {
            String copyFromTextPath = copyFromText.getAbsolutePath().replace(File.separatorChar, '/');
            String thisPath = getRoot().getAbsolutePath().replace(File.separatorChar, '/');
            workingText = copyFromTextPath.substring(thisPath.length());
            if (workingText.startsWith("/")) {
                workingText = workingText.substring(1);
            }
        }
       
        File tmpTarget = SVNTranslator.detranslateWorkingCopy(this, workingText, propChanges, false);
        base = SVNTranslator.maybeUpdateTargetEOLs(this, base, propChanges);
        File resultFile = SVNAdminUtil.createTmpFile(this);

        SVNMergeFileSet mergeFileSet = new SVNMergeFileSet(this, log, base, tmpTarget, localPath, latest,
                resultFile, copyFromText, mimeType);

        mergeFileSet.setMergeLabels(baseLabel, localLabel, latestLabel);

      SVNMergeResult mergeResult;
      try {
          mergeResult = merger.mergeText(mergeFileSet, dryRun, options);
      }
      finally {
        if (dryRun) {
            SVNFileUtil.deleteFile(resultFile);
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
       
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);
        propDiff = propDiff == null ? new SVNProperties() : propDiff;

        SVNMergeResult result = merger.mergeProperties(name, workingProps, baseProps, serverBaseProps,
                propDiff, this, log, baseMerge, dryRun);

        return result.getMergeStatus();
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.ISVNMerger

        byte[] conflictStart = ("<<<<<<< " + localLabel).getBytes();
        byte[] conflictEnd = (">>>>>>> " + latestLabel).getBytes();
        byte[] separator = ("=======").getBytes();
        ISVNMergerFactory factory = myWCAccess.getOptions().getMergerFactory();
        ISVNMerger merger = factory.createMerger(conflictStart, separator, conflictEnd);

        String workingText = localPath;
        if (copyFromText != null) {
            String copyFromTextPath = copyFromText.getAbsolutePath().replace(File.separatorChar, '/');
            String thisPath = getRoot().getAbsolutePath().replace(File.separatorChar, '/');
            workingText = copyFromTextPath.substring(thisPath.length());
            if (workingText.startsWith("/")) {
                workingText = workingText.substring(1);
            }
        }
       
        File tmpTarget = SVNTranslator.detranslateWorkingCopy(this, workingText, propChanges, false);
        base = SVNTranslator.maybeUpdateTargetEOLs(this, base, propChanges);
        File resultFile = SVNAdminUtil.createTmpFile(this);

        SVNMergeFileSet mergeFileSet = new SVNMergeFileSet(this, log, base, tmpTarget, localPath, latest,
                resultFile, copyFromText, mimeType);

        mergeFileSet.setMergeLabels(baseLabel, localLabel, latestLabel);

      SVNMergeResult mergeResult;
      try {
          mergeResult = merger.mergeText(mergeFileSet, dryRun, options);
      }
      finally {
        if (dryRun) {
            SVNFileUtil.deleteFile(resultFile);
        }
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.