Package org.tmatesoft.svn.core.wc

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


    }

    public void testConversion() throws SVNException, IOException {
        SVNClientManager ourClientManager = SVNClientManager.newInstance();
        // checkout working copy
        SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
        updateClient.setIgnoreExternals(false);
        updateClient.doCheckout(tgtURL, WORKING_COPY, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY, true);
        // add file under version control
        int id1 = 45;
        create(ourClientManager, id1);
        modify(ourClientManager, id1);
        int id2 = 2;
View Full Code Here


    }

    public void testTitleAdding() throws SVNException, IOException, JDOMException {
        SVNClientManager ourClientManager = SVNClientManager.newInstance();
        // checkout working copy
        SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
        updateClient.setIgnoreExternals(false);
        updateClient.doCheckout(tgtURL, WORKING_COPY, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY, true);
        // add file under version control
        int id = 1;
        create(ourClientManager, id);
        modify(ourClientManager, id);
        delete(ourClientManager, id);
View Full Code Here

        SVNRevision revision = parseRevision(getCommandLine());
        if (!revision.isValid()) {
            revision = SVNRevision.HEAD;
        }
        getClientManager().setEventHandler(new SVNCommandEventProcessor(out, err, false, false));
        SVNUpdateClient updater = getClientManager().getUpdateClient();
        try {
            SVNURL switchURL = SVNURL.parseURIEncoded(url);
           
            if (getCommandLine().hasArgument(SVNArgument.RELOCATE)) {
                SVNURL targetURL = SVNURL.parseURIEncoded(getCommandLine().getURL(1));
                File file = new File(absolutePath).getAbsoluteFile();
                file = new File(SVNPathUtil.validateFilePath(file.getAbsolutePath()));
                updater.doRelocate(file, switchURL, targetURL, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
            } else {
                File file = new File(absolutePath).getAbsoluteFile();
                file = new File(SVNPathUtil.validateFilePath(file.getAbsolutePath()));
                updater.getDebugLog().info("switching path: " + file);
                updater.doSwitch(file, switchURL, revision, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
            }
        } catch (Throwable th) {
            updater.getDebugLog().info(th);
            println(err, th.getMessage());
            println(err);
            System.exit(1);
        }
    }
View Full Code Here

            path = new File(".", SVNEncodingUtil.uriDecode(SVNPathUtil.tail(url))).getAbsolutePath();
        }

        SVNRevision revision = parseRevision(getCommandLine());
        getClientManager().setEventHandler(new SVNCommandEventProcessor(out, err, true));
        SVNUpdateClient updater = getClientManager().getUpdateClient();
        if (getCommandLine().getURLCount() == 1) {
            SVNRevision pegRevision = getCommandLine().getPegRevision(0);
            updater.doCheckout(SVNURL.parseURIEncoded(url), new File(path), pegRevision, revision, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
        } else {
            for(int i = 0; i < getCommandLine().getURLCount(); i++) {
                String curl = getCommandLine().getURL(i);
                File dstPath = new File(path, SVNEncodingUtil.uriDecode(SVNPathUtil.tail(curl)));
                SVNRevision pegRevision = getCommandLine().getPegRevision(i);
                updater.doCheckout(SVNURL.parseURIEncoded(url), dstPath, pegRevision, revision, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
            }
        }
  }
View Full Code Here

        }
        return -1;
    }

    public long doSwitch(String path, String url, Revision revision, boolean recurse) throws ClientException {
        SVNUpdateClient updater = getSVNUpdateClient();
        try {
            return updater.doSwitch(new File(path).getAbsoluteFile(), SVNURL.parseURIEncoded(url), JavaHLObjectFactory.getSVNRevision(revision), recurse);
        } catch (SVNException e) {
            throwException(e);
        }
        return -1;
    }
View Full Code Here

            throwException(e);
        }
    }

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

     *
     * @param changes ArrayList of SVNDiffStatus objects for export, passing null will populate with the results of {@link SVNChangedFiles#list()}
     */
    public void export(ArrayList changes) {
        if (changes == null) changes = list();
        SVNUpdateClient updateClient = new SVNUpdateClient(authManager, SVNWCUtil.createDefaultOptions(true));
        try {

            for (int idx = 0; idx < changes.size(); idx++) {
                SVNDiffStatus change = (SVNDiffStatus) changes.get(idx);
                File destination = new File(destinationDirectory + "\\" + change.getPath());
                updateClient.doExport(change.getURL(), destination, this.endingRevision, this.endingRevision, null, true, false);
            }
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

            final String path;
            path = getCommandLine().getPathAt(i);

            SVNRevision revision = parseRevision(getCommandLine());
            getClientManager().setEventHandler(new SVNCommandEventProcessor(out, err, false));
            SVNUpdateClient updater = getClientManager().getUpdateClient();
           
            File file = new File(path).getAbsoluteFile();
            if (!file.exists()) {
                File parent = file.getParentFile();
                if (!parent.exists() || !SVNWCUtil.isVersionedDirectory(parent)) {
                    if (!getCommandLine().hasArgument(SVNArgument.QUIET)) {
                        println(out, "Skipped '" +  SVNFormatUtil.formatPath(file).replace('/', File.separatorChar) + "'");
                    }
                    continue;
                }
            }
            try {
                updater.doUpdate(file.getAbsoluteFile(), revision, !getCommandLine().hasArgument(SVNArgument.NON_RECURSIVE));
            } catch (Throwable th) {
                updater.getDebugLog().info(th);
                println(err, th.getMessage());
                println(err);
                error = true;
            }
        }
View Full Code Here

        }
        return (LogMessage[]) entries.toArray(new LogMessage[entries.size()]);
    }

    public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, boolean recurse, boolean ignoreExternals) 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), recurse);
        } catch (SVNException e) {
            throwException(e);
        } finally {
            updater.setIgnoreExternals(oldIgnoreExternals);
        }
        return -1;
    }
View Full Code Here

            throwException(e);
        }
    }

    public long update(String path, Revision revision, boolean recurse) throws ClientException {
        SVNUpdateClient client = getSVNUpdateClient();
        try {
            return client.doUpdate(new File(path).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(revision), recurse);
        } catch (SVNException e) {
            throwException(e);
        }
        return -1;
    }
View Full Code Here

TOP

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

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.