Examples of SVNUpdateClient


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

    }

    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

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

    }

    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

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

        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

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

            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

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

        }
        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

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

            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
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.