Examples of SVNDiffClient


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

     */
    public void getLogEligibleMergeInfo(File path, SVNRevision pegRevision,
            File mergeSrcPath, SVNRevision srcPegRevision, boolean discoverChangedPaths,
            String[] revisionProperties, ISVNLogEntryHandler handler) throws SVNException {
        if (this instanceof SVNDiffClient) {
            SVNDiffClient diffClient = (SVNDiffClient) this;
            diffClient.doGetLogEligibleMergeInfo(path, pegRevision, mergeSrcPath, srcPegRevision,
                    discoverChangedPaths, revisionProperties, handler);
        }
    }
View Full Code Here

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

     */
    public void getLogEligibleMergeInfo(SVNURL url, SVNRevision pegRevision,
            File mergeSrcPath, SVNRevision srcPegRevision, boolean discoverChangedPaths,
            String[] revisionProperties, ISVNLogEntryHandler handler) throws SVNException {
        if (this instanceof SVNDiffClient) {
            SVNDiffClient diffClient = (SVNDiffClient) this;
            diffClient.doGetLogEligibleMergeInfo(url, pegRevision, mergeSrcPath, srcPegRevision,
                    discoverChangedPaths, revisionProperties, handler);
        }
    }
View Full Code Here

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

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

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

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

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

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

     * @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

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

            indexEnd = url.length();
        }
        String sub = url.substring(index, indexEnd);
        String trunk = url.replace(sub, "/trunk");

        SVNDiffClient diffClient = manager.getDiffClient();

        Map<SVNURL, SVNMergeRangeList> map = diffClient.doGetMergedMergeInfo(status.getFile(), SVNRevision.HEAD);

        if (map == null) {
            getLog().warn("There is NO mergeinfo property, please try manually merge first.");
            return;
        }

        SVNMergeRangeList value = map.get(SVNURL.parseURIDecoded(trunk));

        long start = 1;
        if (value != null) {
            start = value.getRanges()[value.getRanges().length - 1].getEndRevision();
        } else {
            SVNLogEntryHandler handler = new SVNLogEntryHandler();
            manager.getLogClient().doLog(status.getURL(), new String[] { "." }, SVNRevision.UNDEFINED,
                    SVNRevision.create(1), /* start, defaults to peg */
                    SVNRevision.HEAD, /* end, defaults to 0 */
                    true, /* stop on copy */
                    false, /* include paths */
                    false, /* include mergeinfo */
                    -1, /* no limit */
                    null, /* all revprops */
                    handler);

            start = handler.getStart();
        }

        SVNRevisionRange range = new SVNRevisionRange(SVNRevision.create(start), status.getRevision());
        String command = "svn merge -r " + range.getStartRevision() + ":" + range.getEndRevision() + " " + trunk;

        getLog().info(command);

        diffClient.setEventHandler(new ISVNEventHandler() {

            public void checkCancelled() throws SVNCancelException {
            }

            public void handleEvent(SVNEvent event, double progress) throws SVNException {
                String path = event.getFile().getAbsolutePath();
                int index = path.indexOf(".");
                path = path.replace(path.substring(0, index), "");
                System.console().writer().printf("%1$#17s '%2$s'%n", event.getAction().toString(), path);
            }
        });

        diffClient.doMerge(SVNURL.parseURIEncoded(trunk), SVNRevision.HEAD, Collections.singleton(range),
                new File("."), SVNDepth.UNKNOWN, true, false, false, false);

        getLog().info("svn ci -m \"MERGED: " + command + "\"");
    }
View Full Code Here

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

            //commit local changes
            SVNCommitClient commitClient = clientManager.getCommitClient();
            commitClient.doCommit(new File[] { wcRoot }, false, "committing changes", null, null, false, false, SVNDepth.INFINITY);
           
            //now diff the base revision of the working copy against the repository
            SVNDiffClient diffClient = clientManager.getDiffClient();
            SVNRevisionRange rangeToMerge = new SVNRevisionRange(SVNRevision.create(1), SVNRevision.HEAD);
           
            diffClient.doMerge(A_URL, SVNRevision.HEAD, Collections.singleton(rangeToMerge),
                    new File(wcRoot, "A_copy"), SVNDepth.UNKNOWN, true, false, false, false);
           
            //now make some changes to the A tree again
            //change file contents of iota and A/D/gamma
            SamplesUtility.writeToFile(new File(wcRoot, "iota"), "New text2 appended to 'iota'", true);
            SamplesUtility.writeToFile(new File(wcRoot, "A/D/gamma"), "New text in 'gamma'", false);
            //remove A/C from version control
            wcClient.doDelete(new File(wcRoot, "A/C"), false, true, false);

            //commit local changes
            commitClient.doCommit(new File[] { wcRoot }, false, "committing changes again", null, null, false, false, SVNDepth.INFINITY);

            /* do the same merge call, merge-tracking feature will merge only those revisions
             * which were not still merged.
             */
            diffClient.doMerge(A_URL, SVNRevision.HEAD, Collections.singleton(rangeToMerge),
                    new File(wcRoot, "A_copy"), SVNDepth.UNKNOWN, true, false, false, false);
           
        } catch (SVNException svne) {
            System.out.println(svne.getErrorMessage());
            System.exit(1);
View Full Code Here

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

            //roll back changes in the working copy - update to revision 1
            SVNUpdateClient updateClient = clientManager.getUpdateClient();
            updateClient.doUpdate(wcRoot, SVNRevision.create(1), SVNDepth.INFINITY, false, false);
           
            //now diff the base revision of the working copy against the repository
            SVNDiffClient diffClient = clientManager.getDiffClient();

            /*
             * This corresponds to 'svn diff -rBASE:HEAD'.
             */
            diffClient.doDiff(wcRoot, SVNRevision.UNDEFINED, SVNRevision.BASE, SVNRevision.HEAD,
                    SVNDepth.INFINITY, true, System.out, null);
        } catch (SVNException svne) {
            System.out.println(svne.getErrorMessage());
            System.exit(1);
        } catch (IOException ioe) {
View Full Code Here

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

            SVNWCClient wcClient = SVNClientManager.newInstance().getWCClient();
            wcClient.doSetProperty(new File(wcRoot, "A/B"), "spam", SVNPropertyValue.create("egg"), false,
                    SVNDepth.EMPTY, null, null);
           
            //now run diff the working copy against the repository
            SVNDiffClient diffClient = clientManager.getDiffClient();

            /*
             * This corresponds to 'svn diff -rHEAD'.
             */
            diffClient.doDiff(wcRoot, SVNRevision.UNDEFINED, SVNRevision.WORKING, SVNRevision.HEAD,
                    SVNDepth.INFINITY, true, System.out, null);
        } catch (SVNException svne) {
            System.out.println(svne.getErrorMessage());
            System.exit(1);
        } catch (IOException ioe) {
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.