Examples of SVNUpdateClient


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

   * only child entries of the directory;
   */
  private static long checkout(SVNURL url, SVNRevision revision,
      File destPath, boolean isRecursive) throws SVNException {

    SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
    /*
     * sets externals not to be ignored during the checkout
     */
    updateClient.setIgnoreExternals(false);
    /*
     * returns the number of the revision at which the working copy is
     */
    return updateClient.doCheckout(url, destPath, revision, revision,
        isRecursive);
  }
View Full Code Here

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

   * of the directory;
   */
  private static long update(File wcPath, SVNRevision updateToRevision,
      boolean isRecursive) throws SVNException {

    SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
    /*
     * sets externals not to be ignored during the update
     */
    updateClient.setIgnoreExternals(false);
    /*
     * returns the number of the revision wcPath was updated to
     */
    return updateClient.doUpdate(wcPath, updateToRevision, isRecursive);
  }
View Full Code Here

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

   * of the directory;
   */
  private static long switchToURL(File wcPath, SVNURL url,
      SVNRevision updateToRevision, boolean isRecursive)
      throws SVNException {
    SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
    /*
     * sets externals not to be ignored during the switch
     */
    updateClient.setIgnoreExternals(false);
    /*
     * returns the number of the revision wcPath was updated to
     */
    return updateClient
        .doSwitch(wcPath, url, updateToRevision, isRecursive);
  }
View Full Code Here

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

    public long[] update(String[] path, Revision revision, int depth, boolean depthIsSticky, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException {
        if (path == null || path.length == 0) {
            return new long[]{};
        }
        long[] updated = new long[path.length];
        SVNUpdateClient updater = getSVNUpdateClient();
        boolean oldIgnore = updater.isIgnoreExternals();
        updater.setIgnoreExternals(ignoreExternals);
        updater.setEventPathPrefix("");
        SVNDepth svnDepth = JavaHLObjectFactory.getSVNDepth(depth);
        SVNRevision rev = JavaHLObjectFactory.getSVNRevision(revision);
        try {
            for (int i = 0; i < updated.length; i++) {
                updated[i] = updater.doUpdate(new File(path[i]).getAbsoluteFile(), rev, svnDepth,
                        allowUnverObstructions, depthIsSticky);
            }
        } catch (SVNException e) {
            throwException(e);
        } finally {
            updater.setIgnoreExternals(oldIgnore);
            updater.setEventPathPrefix(null);
            resetLog();
            SVNFileUtil.sleepForTimestamp();
        }
        return updated;
    }
View Full Code Here

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

    public long doExport(String srcPath, String destPath, Revision revision, Revision pegRevision, boolean force, boolean ignoreExternals, boolean recurse, String nativeEOL) throws ClientException {
        return doExport(srcPath, destPath, revision, pegRevision, force, ignoreExternals, JavaHLObjectFactory.infinityOrFiles(recurse), nativeEOL);
    }

    public long doExport(String srcPath, String destPath, Revision revision, Revision pegRevision, boolean force, boolean ignoreExternals, int depth, String nativeEOL) throws ClientException {
        SVNUpdateClient updater = getSVNUpdateClient();
        boolean oldIgnore = updater.isIgnoreExternals();
        updater.setIgnoreExternals(ignoreExternals);
        try {
            if (isURL(srcPath)) {
                return updater.doExport(SVNURL.parseURIEncoded(srcPath), new File(destPath).getAbsoluteFile(),
                        JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth));
            }
            return updater.doExport(new File(srcPath).getAbsoluteFile(), new File(destPath).getAbsoluteFile(),
                    JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth));
        } catch (SVNException e) {
            throwException(e);
        } finally {
            updater.setIgnoreExternals(oldIgnore);
            resetLog();
        }
        return -1;
    }
View Full Code Here

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

            resetLog();
        }
    }

    public void relocate(String from, String to, String path, boolean recurse) throws ClientException {
        SVNUpdateClient client = getSVNUpdateClient();
        try {
            client.doRelocate(new File(path).getAbsoluteFile(), SVNURL.parseURIEncoded(from), SVNURL.parseURIEncoded(to), recurse);
        } catch (SVNException e) {
            throwException(e);
        } finally {
            resetLog();
        }
View Full Code Here

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

        return doSwitch(path, url, revision, Revision.HEAD, JavaHLObjectFactory.unknownOrFiles(recurse), false, false, false);
    }

    public long doSwitch(String path, String url, Revision revision, Revision pegRevision, int depth,
            boolean depthIsSticky, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException {
        SVNUpdateClient updater = getSVNUpdateClient();
        try {
            return updater.doSwitch(new File(path).getAbsoluteFile(), SVNURL.parseURIEncoded(url),
                    JavaHLObjectFactory.getSVNRevision(pegRevision),
                    JavaHLObjectFactory.getSVNRevision(revision), JavaHLObjectFactory.getSVNDepth(depth),
                    allowUnverObstructions, depthIsSticky);
        } catch (SVNException e) {
            throwException(e);
View Full Code Here

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

    public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, boolean recurse, boolean ignoreExternals) throws ClientException {
        return checkout(moduleName, destPath, revision, pegRevision, JavaHLObjectFactory.infinityOrFiles(recurse), ignoreExternals, false);
    }

    public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, int depth, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException {
        SVNUpdateClient updater = getSVNUpdateClient();
        boolean oldIgnoreExternals = updater.isIgnoreExternals();
        updater.setIgnoreExternals(ignoreExternals);
        try {
            File path = new File(destPath).getAbsoluteFile();
            return updater.doCheckout(SVNURL.parseURIEncoded(moduleName), path, JavaHLObjectFactory.getSVNRevision(pegRevision),
                    JavaHLObjectFactory.getSVNRevision(revision), JavaHLObjectFactory.getSVNDepth(depth), allowUnverObstructions);
        } catch (SVNException e) {
            throwException(e);
        } finally {
            updater.setIgnoreExternals(oldIgnoreExternals);
            resetLog();
        }
        return -1;
    }
View Full Code Here

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

        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);
View Full Code Here

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

                to = SVNEncodingUtil.uriDecode(to);
            }
        } else {
            to = (String) targets.get(1);
        }
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment(), false, true, false));
        }
        SVNDepth depth = getSVNEnvironment().getDepth();
        if (depth == SVNDepth.UNKNOWN) {
            depth = SVNDepth.INFINITY;
        }
        try {
            SVNPath dst = new SVNPath(to);
            String eol = getSVNEnvironment().getNativeEOL();
            SVNRevision revision = getSVNEnvironment().getStartRevision();
            if (from.isFile()) {
                client.doExport(from.getFile(), dst.getFile(), pegRevision, revision, eol, getSVNEnvironment().isForce(), depth);
            } else {
                client.doExport(from.getURL(), dst.getFile(), pegRevision, revision, eol, getSVNEnvironment().isForce(), depth);
            }
        } catch (SVNException e) {
            SVNErrorMessage err = e.getErrorMessage();
            if (err != null && err.getErrorCode() == SVNErrorCode.WC_OBSTRUCTED_UPDATE) {
                err = err.wrap("Destination directory exists; please remove the directory or use --force to overwrite");
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.