Package org.tmatesoft.svn.core.wc

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


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

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

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

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

        File reposRoot = new File(baseDirectory, "tempRepository");
        File wcRoot = new File(workDir, "working_copy");
       
        SVNClientManager clientManager = SVNClientManager.newInstance();       
        SVNAdminClient adminClient = clientManager.getAdminClient();
        SVNDiffClient diffClient = clientManager.getDiffClient();    
        DefaultSVNOptions options = (DefaultSVNOptions) diffClient.getOptions();
        options.setConflictHandler(new ConflictResolverHandler());
        SVNCommitClient commitClient = clientManager.getCommitClient();
       
        boolean fileRepo = true;
       
        String url = "svn://192.168.56.101/project6";
        final SVNURL reposURL = (fileRepo? SVNURL.fromFile(reposRoot) : SVNURL.parseURIEncoded(url)),
      demoURL = reposURL.appendPath("demo", false);       
        if (fileRepo)
          adminClient.doCreateRepository(reposRoot, null, true, true, false, false);
        else
        {
          SubversionSubmitter.setUpSVNKit();
          //SVNRepository repository = SVNRepositoryFactory.create(reposURL);
          ISVNAuthenticationManager m = SVNWCUtil.createDefaultAuthenticationManager("harry", "secret");
         //repository.setAuthenticationManager(m);
         clientManager.setAuthenticationManager(m);
        }
        logger.info("Repo URL = "+ reposURL);
        repos =  SVNRepositoryFactory.create(reposURL);
       
        SVNCommitInfo info;       
        String msg;

        msg = "Import of oldDMO tree";
        info = clientManager.getCommitClient( ).doImport( oldDemoTree , demoURL , msg , true);
        logger.info("Imported oldDemo tree: "+ info);
        //final long revOldDemo = info.getNewRevision();
           
        msg= "Copy demo to custom";
        SVNCopyClient copyClient = clientManager.getCopyClient();
        SVNURL customURL = reposURL.appendPath("custom", true);
        SVNCopySource copySource = new SVNCopySource(SVNRevision.UNDEFINED, SVNRevision.HEAD, demoURL);
        info = copyClient.doCopy(new SVNCopySource[] { copySource }, customURL, false, false, true,
                msg, null);
        final long revAfterCopyToCustom = info.getNewRevision();
        logger.info(msg + ": " + info);
               
        File  demoDir = new File(wcRoot, "demo"),
          customDir = new File(wcRoot, "custom");
       
        SVNUpdateClient updateClient = clientManager.getUpdateClient();
        updateClient.doCheckout(reposURL, wcRoot, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY,
                false);
        logger.info("Checked out working copy to " + wcRoot);
       
        overwriteTree(newDemoTree, demoDir);
/*       
        for (File f: dirsCreated)
          clientManager.getWCClient( ).doAdd( f, false , false , false , false );
        for (File f: filesCreated)
          clientManager.getWCClient( ).doAdd( f, false , false , false , false );
*/
        msg = "Commit of newDMO (in demo tree)";
        info = commitClient.doCommit(new File[] { wcRoot }, false, msg, null, null, false,
                              false, SVNDepth.INFINITY);       
        //final long revNewDMO = info.getNewRevision();
/*
        diffClient.doDiffStatus(reposURL, SVNRevision.create(revOldDemo), reposURL, SVNRevision.create(revNewDMO),
            true, true, new ISVNDiffStatusHandler() {       
          public void handleDiffStatus(SVNDiffStatus arg0) throws SVNException {
            if (arg0.getURL().toString().endsWith(".pcode"))
            {
              logger.info("Diff in NewDMO-OldDMO: " + arg0.getURL());

               logger.info("path = " + arg0.getPath());
                  SVNProperties properties = SVNProperties.wrap(new HashMap());
                  if (repos.checkPath("/" + arg0.getPath(), revOldDemo) == SVNNodeKind.FILE
                      && repos.checkPath("/" + arg0.getPath(), revNewDMO) == SVNNodeKind.FILE)
                  {
                deltaOldDMONewDMO.add(arg0.getURL());
                    repos.getFile( "/" + arg0.getPath(), revOldDemo, properties, null);
                    String oldCheckSum = properties.getStringValue(SVNProperty.CHECKSUM);
                    repos.getFile("/" +arg0.getPath(), revNewDMO, properties, null);
                    String newCheckSum = properties.getStringValue(SVNProperty.CHECKSUM);
                    logger.info("Checksums: " + oldCheckSum + " " + newCheckSum);
                  }
            }
          }
        });
*/
        logger.info(msg + ":" + info);

        dirsCreated.clear(); filesCreated.clear();
        overwriteTree(oldDevTree, customDir);
/*
        msg = "Commit of old DEV";
        info = commitClient.doCommit(new File[] { wcRoot }, false, msg, null, null, false,
                              false, SVNDepth.INFINITY);         
        logger.info(msg + ":" + info);
        long revOldDEV = info.getNewRevision();
        diffClient.doDiffStatus(reposURL, SVNRevision.create(revNewDMO), reposURL, SVNRevision.create(revOldDEV),
            true, true, new ISVNDiffStatusHandler() {       
          public void handleDiffStatus(SVNDiffStatus arg0) throws SVNException {
            if (arg0.getURL().toString().endsWith(".pcode"))
            {
              logger.fine("Diff in DEV-oldDMO: " + arg0.getURL());
              deltaOldDMODev.add(arg0.getURL());
            }
          }
        });
*/
        updateClient = clientManager.getUpdateClient();
        updateClient.doCheckout(reposURL, wcRoot, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY,
                false);
        logger.info("Checked out working copy to " + wcRoot);       
       
        File targetOfMerge = (mergeToDMO? demoDir: customDir);
        SVNURL sourceOfMerge = (mergeToDMO? customURL : demoURL);
        SVNRevisionRange rangeToMerge = new SVNRevisionRange(SVNRevision.create(revAfterCopyToCustom), SVNRevision.HEAD);       
        wcFilesNotMerged.clear();
               
        diffClient.doMerge(sourceOfMerge, SVNRevision.create(revAfterCopyToCustom), Collections.singleton(rangeToMerge),
                targetOfMerge, SVNDepth.INFINITY, true, false, false, false);
               
        logger.info("Finished merging");

        /*
 
View Full Code Here

        // Prepare required arguments.
        SVNURL svnURL = SVNURL.fromFile(new File(getRepoPrefix() + ownerName + "/" + projectName));

        // Get diffClient.
        SVNClientManager clientManager = SVNClientManager.newInstance();
        SVNDiffClient diffClient = clientManager.getDiffClient();

        // Using diffClient, write the changes by commitId into
        // byteArrayOutputStream, as unified format.
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        diffClient.doDiff(svnURL, null, SVNRevision.create(revA), SVNRevision.create(revB),
                SVNDepth.INFINITY, true, byteArrayOutputStream);

        return byteArrayOutputStream.toString();
    }
View Full Code Here

        }while(needToRetry);
  }

  public void doDiff(SVNURL url, long revisionA, SVNURL url2, long revisionB,
      ByteArrayOutputStream baos) throws SVNException {
    SVNDiffClient diffClient = clientManager.getDiffClient();
    boolean needToRetry = true;
        int retries = 0;
        do {
            try {
                diffClient.doDiff(url, SVNRevision.create(revisionA),
                        url2, SVNRevision.create(revisionB),
                        SVNDepth.INFINITY, false, baos);
                needToRetry = false;
            } catch (SVNException e) {
                if(isNotFoundAtRevisionException(e)){
View Full Code Here

                tgtPegRevision = SVNRevision.BASE;
            }
        }
       
       
        SVNDiffClient client = getSVNEnvironment().getClientManager().getDiffClient();
        if (getSVNEnvironment().getShowRevisionType() == SVNShowRevisionType.MERGED) {
            if (target.isURL()) {
                if (source.isURL()) {
                    client.doGetLogMergedMergeInfo(target.getURL(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogMergedMergeInfo(target.getURL(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            } else {
                if (source.isURL()) {
                    client.doGetLogMergedMergeInfo(target.getFile(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogMergedMergeInfo(target.getFile(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            }
        } else if (getSVNEnvironment().getShowRevisionType() == SVNShowRevisionType.ELIGIBLE) {
            if (target.isURL()) {
                if (source.isURL()) {
                    client.doGetLogEligibleMergeInfo(target.getURL(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogEligibleMergeInfo(target.getURL(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            } else {
                if (source.isURL()) {
                    client.doGetLogEligibleMergeInfo(target.getFile(), tgtPegRevision, source.getURL(), srcPegRevision,
                            false, null, this);
                } else {
                    client.doGetLogEligibleMergeInfo(target.getFile(), tgtPegRevision, source.getFile(), srcPegRevision,
                            false, null, this);
                }
            }
        }
    }
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.