Package org.tmatesoft.svn.core.wc

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


     * @deprecate             use {@link org.tmatesoft.svn.core.wc.SVNDiffClient#doSuggestMergeSources(File, SVNRevision)}
     *                        instead
     */
    public Collection suggestMergeSources(File path, SVNRevision pegRevision) throws SVNException {
        if (this instanceof SVNDiffClient) {
            SVNDiffClient diffClient = (SVNDiffClient) this;
            return diffClient.doSuggestMergeSources(path, pegRevision);
        }
        return null;
    }
View Full Code Here


     * @deprecated            use {@link org.tmatesoft.svn.core.wc.SVNDiffClient#doSuggestMergeSources(SVNURL, SVNRevision)}
     *                        instead
     */
    public Collection suggestMergeSources(SVNURL url, SVNRevision pegRevision) throws SVNException {
        if (this instanceof SVNDiffClient) {
            SVNDiffClient diffClient = (SVNDiffClient) this;
            return diffClient.doSuggestMergeSources(url, pegRevision);
        }
        return null;
    }
View Full Code Here

            }
        }
        if (target == null) {
            target = new SVNPath("");
        }
        SVNDiffClient client = getSVNEnvironment().getClientManager().getDiffClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
        }
        try {
            client.setMergeOptions(getSVNEnvironment().getDiffOptions());
            if (!twoSourcesSpecified) {
                if (firstRangeStart == SVNRevision.UNDEFINED && firstRangeEnd == SVNRevision.UNDEFINED) {
                  SVNRevisionRange range = new SVNRevisionRange(SVNRevision.create(1), pegRevision1);
                  rangesToMerge = new LinkedList();
                  rangesToMerge.add(range);
                }
               
                if (source1 == null) {
                    source1 = target;
                }
               
                if (getSVNEnvironment().isReIntegrate()) {
                    if (getSVNEnvironment().getDepth() != SVNDepth.UNKNOWN) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_MUTUALLY_EXCLUSIVE_ARGS,
                                "--depth cannot be used with --reintegrate");
                        SVNErrorManager.error(err, SVNLogType.CLIENT);
                    }
                   
                    if (getSVNEnvironment().isForce()) {
                        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CL_MUTUALLY_EXCLUSIVE_ARGS,
                                "--force cannot be used with --reintegrate");
                        SVNErrorManager.error(err, SVNLogType.CLIENT);
                    }
                   
                    if (source1.isURL()) {
                        client.doMergeReIntegrate(source1.getURL(), pegRevision1, target.getFile(),
                                getSVNEnvironment().isDryRun());
                    } else {
                        client.doMergeReIntegrate(source1.getFile(), pegRevision1, target.getFile(),
                                getSVNEnvironment().isDryRun());
                    }
                } else {
                    if (source1.isURL()) {
                        client.doMerge(source1.getURL(), pegRevision1, rangesToMerge, target.getFile(),
                                getSVNEnvironment().getDepth(), !getSVNEnvironment().isIgnoreAncestry(),
                                getSVNEnvironment().isForce(), getSVNEnvironment().isDryRun(),
                                getSVNEnvironment().isRecordOnly());
                    } else {
                        client.doMerge(source1.getFile(), pegRevision1, rangesToMerge, target.getFile(),
                                getSVNEnvironment().getDepth(), !getSVNEnvironment().isIgnoreAncestry(),
                                getSVNEnvironment().isForce(), getSVNEnvironment().isDryRun(),
                                getSVNEnvironment().isRecordOnly());
                    }
                }
            } else {
                if (source1.isURL() && source2.isURL()) {
                    client.doMerge(source1.getURL(), firstRangeStart, source2.getURL(), firstRangeEnd,
                        target.getFile(), getSVNEnvironment().getDepth(),
                        !getSVNEnvironment().isIgnoreAncestry(), getSVNEnvironment().isForce(),
                        getSVNEnvironment().isDryRun(), getSVNEnvironment().isRecordOnly());
                } else if (source1.isURL() && source2.isFile()) {
                    client.doMerge(source1.getURL(), firstRangeStart, source2.getFile(), firstRangeEnd,
                        target.getFile(), getSVNEnvironment().getDepth(),
                        !getSVNEnvironment().isIgnoreAncestry(), getSVNEnvironment().isForce(),
                        getSVNEnvironment().isDryRun(), getSVNEnvironment().isRecordOnly());
                } else if (source1.isFile() && source2.isURL()) {
                    client.doMerge(source1.getFile(), firstRangeStart, source2.getURL(), firstRangeEnd,
                        target.getFile(), getSVNEnvironment().getDepth(),
                        !getSVNEnvironment().isIgnoreAncestry(), getSVNEnvironment().isForce(),
                        getSVNEnvironment().isDryRun(), getSVNEnvironment().isRecordOnly());
                } else {
                    client.doMerge(source1.getFile(), firstRangeStart, source2.getFile(), firstRangeEnd,
                        target.getFile(), getSVNEnvironment().getDepth(),
                        !getSVNEnvironment().isIgnoreAncestry(), getSVNEnvironment().isForce(),
                        getSVNEnvironment().isDryRun(), getSVNEnvironment().isRecordOnly());
                }
            }
View Full Code Here

        }
        if (targets.isEmpty()) {
            targets.add("");
        }

        SVNDiffClient client = getSVNEnvironment().getClientManager().getDiffClient();
        DefaultSVNDiffGenerator diffGenerator = new DefaultSVNDiffGenerator();
        if (getSVNEnvironment().getDiffCommand() != null) {
            diffGenerator.setExternalDiffCommand(getSVNEnvironment().getDiffCommand());
            diffGenerator.setRawDiffOptions(getSVNEnvironment().getExtensions());
        } else {
            diffGenerator.setDiffOptions(getSVNEnvironment().getDiffOptions());
        }
       
        diffGenerator.setDiffDeleted(!getSVNEnvironment().isNoDiffDeleted());
        diffGenerator.setForcedBinaryDiff(getSVNEnvironment().isForce());
        diffGenerator.setBasePath(new File("").getAbsoluteFile());
        diffGenerator.setFallbackToAbsolutePath(true);
        diffGenerator.setOptions(client.getOptions());
        client.setDiffGenerator(diffGenerator);
       
        PrintStream ps = getSVNEnvironment().getOut();
        Collection changeLists = getSVNEnvironment().getChangelistsCollection();
        for(int i = 0; i < targets.size(); i++) {
            String targetName = (String) targets.get(i);
            if (!peggedDiff) {
                SVNPath target1 = new SVNPath(SVNPathUtil.append(oldTarget.getTarget(), targetName));
                SVNPath target2 = new SVNPath(SVNPathUtil.append(newTarget.getTarget(), targetName));
                if (getSVNEnvironment().isSummarize()) {
                    if (target1.isURL() && target2.isURL()) {
                        client.doDiffStatus(target1.getURL(), start, target2.getURL(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
                    } else if (target1.isURL()) {
                        client.doDiffStatus(target1.getURL(), start, target2.getFile(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
                    } else if (target2.isURL()) {
                        client.doDiffStatus(target1.getFile(), start, target2.getURL(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
                    } else {
                        client.doDiffStatus(target1.getFile(), start, target2.getFile(), end, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
                    }
                } else {
                    if (target1.isURL() && target2.isURL()) {
                        client.doDiff(target1.getURL(), start, target2.getURL(), end,
                                getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps);
                    } else if (target1.isURL()) {
                        client.doDiff(target1.getURL(), start, target2.getFile(), end,
                                getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps,
                                changeLists);
                    } else if (target2.isURL()) {
                        client.doDiff(target1.getFile(), start, target2.getURL(), end,
                                getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps,
                                changeLists);
                    } else {
                        client.doDiff(target1.getFile(), start, target2.getFile(), end,
                                getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), ps,
                                changeLists);
                    }
                }
            } else {
                SVNPath target = new SVNPath(targetName, true);
                SVNRevision pegRevision = target.getPegRevision();
                if (pegRevision == SVNRevision.UNDEFINED) {
                    pegRevision = target.isURL() ? SVNRevision.HEAD : SVNRevision.WORKING;
                }
                if (getSVNEnvironment().isSummarize()) {
                    if (target.isURL()) {
                        client.doDiffStatus(target.getURL(), start, end, pegRevision, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
                    } else {
                        client.doDiffStatus(target.getFile(), start, end, pegRevision, getSVNEnvironment().getDepth(), getSVNEnvironment().isNoticeAncestry(), this);
                    }
                } else {
                    if (target.isURL()) {
                        client.doDiff(target.getURL(), pegRevision, start, end, getSVNEnvironment().getDepth(),
                                getSVNEnvironment().isNoticeAncestry(), ps);
                    } else {
                        client.doDiff(target.getFile(), pegRevision, start, end, getSVNEnvironment().getDepth(),
                                getSVNEnvironment().isNoticeAncestry(), ps, changeLists);
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.wc.SVNDiffClient

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.