Examples of SVNUpdateClient


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

            }
            targets.add(lastTarget);
        } else if (targets.size() == 1){
            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT);
        }
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment(), true, false, false));
        }

        SVNRevision revision = getSVNEnvironment().getStartRevision();
        for (int i = 0; i < targets.size() - 1; i++) {
            String targetName = (String) targets.get(i);
            SVNPath target = new SVNPath(targetName, true);
            if (!target.isURL()) {
                SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "''{0}'' doesn not appear to be a URL", targetName), SVNLogType.CLIENT);
            }
            String targetDir;
            SVNPath dstTarget;
            if (targets.size() == 2) {
                // url + path
                targetDir = lastTarget;
                dstTarget = new SVNPath(targetDir);
            } else {
                // all urls + base dst.
                targetDir = target.getURL().getPath();
                targetDir = SVNPathUtil.tail(targetDir);
                targetDir = SVNPathUtil.append(lastTarget, targetDir);
                dstTarget = new SVNPath(targetDir);
            }
            SVNRevision pegRevision = target.getPegRevision();
            if (revision == SVNRevision.UNDEFINED) {
                revision = pegRevision != SVNRevision.UNDEFINED ? pegRevision : SVNRevision.HEAD;
            }
            client.doCheckout(target.getURL(), dstTarget.getFile(), pegRevision, revision, getSVNEnvironment().getDepth(), getSVNEnvironment().isForce());
        }
    }
View Full Code Here

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

        if (pair.mySourceKind == SVNNodeKind.DIR) {
            // do checkout
            String srcURL = pair.myOriginalSource;
            SVNURL url = SVNURL.parseURIEncoded(srcURL);
            SVNUpdateClient updateClient = new SVNUpdateClient(getRepositoryPool(), getOptions());
            updateClient.setEventHandler(getEventDispatcher());

            File dstFile = new File(pair.myDst);
            SVNRevision srcRevision = pair.mySourceRevision;
            SVNRevision srcPegRevision = pair.mySourcePegRevision;
            updateClient.doCheckout(url, dstFile, srcPegRevision, srcRevision, SVNDepth.INFINITY, false);

            if (sameRepositories) {
                url = SVNURL.parseURIEncoded(pair.mySource);

                SVNAdminArea dstArea = dstAccess.open(dstFile, true, SVNWCAccess.INFINITE_DEPTH);
View Full Code Here

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

  @Override
  public void execute() throws Exception
  {
    // Get the Update Client
    SVNUpdateClient client = this.getTask().getSvnClient().getUpdateClient();

    SVNURL svnurl = SVNURL.parseURIDecoded(url);

    this.getTask().log("checkout " + url + " " + path);

    long r = client.doCheckout(svnurl, path, pegRevision, revision, depth, force);
    this.getProject().setProperty(this.revisionProperty, new Long(r).toString());
  }
View Full Code Here

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

    File filePath = new File(this.path);

    this.getTask().log("switch " + filePath.getCanonicalPath() + " to URL " + this.svnUrl + " at revision " + this.revision);

    // Get the Update Client
    SVNUpdateClient client = this.getTask().getSvnClient().getUpdateClient();

    // Execute svn switch
    client.doSwitch(filePath, this.svnUrl, this.pegRevision, this.revision, this.depth, this.allowUnversionedObstructions, this.recursive);
  }
View Full Code Here

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

    File filePath = new File(this.path);

    this.getTask().log("update " + filePath.getCanonicalPath());

    // Get the Update Client
    SVNUpdateClient client = this.getTask().getSvnClient().getUpdateClient();

    // Execute svn info
    long revision = client.doUpdate(filePath, this.revision, this.depth, this.recursive, this.force);

    // Set the computed properties in ant
    this.getProject().setProperty(this.revisionProperty, new Long(revision).toString());
  }
View Full Code Here

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

        if (!getSVNEnvironment().isVersioned(target.getTarget())) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND,
                    "''{0}'' does not appear to be a working copy path", target.getTarget());
            SVNErrorManager.error(err, SVNLogType.CLIENT);
        }
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment(), false, false, false));
        }
       
        SVNDepth depth = getSVNEnvironment().getDepth();
        boolean depthIsSticky = false;
        if (getSVNEnvironment().getSetDepth() != SVNDepth.UNKNOWN) {
            depth = getSVNEnvironment().getSetDepth();
            depthIsSticky = true;
        }
       
        client.doSwitch(target.getFile(), switchURL.getURL(), switchURL.getPegRevision(),
                getSVNEnvironment().getStartRevision(), depth,
                getSVNEnvironment().isForce(), depthIsSticky);   
    }
View Full Code Here

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

        if (from.isURL() != to.isURL() || !from.isURL()) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.INCORRECT_PARAMS,
                    "''{0}'' to ''{1}'' is not a valid relocation", new Object[] {from.getTarget(), to.getTarget()});
            SVNErrorManager.error(err, SVNLogType.CLIENT);
        }
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (targets.size() == 2) {
            SVNPath target = new SVNPath("");
            client.doRelocate(target.getFile(), from.getURL(), to.getURL(), getSVNEnvironment().getDepth().isRecursive());
        } else {
            for(int i = 2; i < targets.size(); i++) {
                SVNPath target = new SVNPath((String) targets.get(i));
                client.doRelocate(target.getFile(), from.getURL(), to.getURL(), getSVNEnvironment().getDepth().isRecursive());
            }
        }
    }
View Full Code Here

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

            };
            changelistClient.doGetChangeListPaths(changeLists, fileTargets, clDepth, handler);
            targets = targetPaths;
        }
       
        SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient();
        if (!getSVNEnvironment().isQuiet()) {
            client.setEventHandler(new SVNNotifyPrinter(getSVNEnvironment()));
        }
       
        SVNDepth depth = getSVNEnvironment().getDepth();
        boolean depthIsSticky = false;
        if (getSVNEnvironment().getSetDepth() != SVNDepth.UNKNOWN) {
            depth = getSVNEnvironment().getSetDepth();
            depthIsSticky = true;
        }
       
        List files = new ArrayList(targets.size());
        for (Iterator ts = targets.iterator(); ts.hasNext();) {
            String targetName = (String) ts.next();
            SVNPath target = new SVNPath(targetName);
            if (!target.isFile()) {
                // skip it.
                getSVNEnvironment().getOut().println("Skipped '" + targetName + "'");
                continue;
            }
            files.add(target.getFile());
        }
        File[] filesArray = (File[]) files.toArray(new File[files.size()]);
        client.doUpdate(filesArray, getSVNEnvironment().getStartRevision(), depth,
                getSVNEnvironment().isForce(), depthIsSticky);
    }
View Full Code Here

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

  private static Logger logger = Logger.getLogger("SVNPostCommit");
 
  public void postCommitHook(String path, String repositoryURL) {
    File dstPath = new File(path);
    SVNClientManager cm = SVNClientManager.newInstance();
    SVNUpdateClient uc = cm.getUpdateClient();
    try {
      uc.doUpdate(dstPath, SVNRevision.HEAD,SVNDepth.INFINITY,true, true);
    } catch (SVNException e) {
      logger.throwing("SVNPostCommit", "postCommitHook", e);
      logger.warning(e.getLocalizedMessage());
      e.printStackTrace(System.err);
    }
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.