Package org.tmatesoft.svn.core.wc

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


            }
        }
    }

    public void cleanup(String path) throws ClientException {
        SVNWCClient client = getSVNWCClient();
        try {
            client.doCleanup(new File(path).getAbsoluteFile());
        } catch (SVNException e) {
            throwException(e);
        } finally {
            resetLog();
        }
View Full Code Here


    public void resolved(String path, boolean recurse) throws ClientException {
        resolve(path, JavaHLObjectFactory.infinityOrEmpty(recurse), ConflictResult.chooseMerged);
    }

    public void resolve(String path, int depth, int conflictResult) throws ClientException {
        SVNWCClient client = getSVNWCClient();
        try {
            client.doResolve(new File(path).getAbsoluteFile(), JavaHLObjectFactory.getSVNDepth(depth), JavaHLObjectFactory.getSVNConflictChoice(conflictResult));
        } catch (SVNException e) {
            throwException(e);
        } finally {
            resetLog();
        }
View Full Code Here

    private PropertyData[] properties(String path, Revision revision, Revision pegRevision, SVNDepth depth,
            String[] changelists) throws ClientException {
        if (path == null) {
            return null;
        }
        SVNWCClient client = getSVNWCClient();
        SVNRevision svnRevision = JavaHLObjectFactory.getSVNRevision(revision);
        SVNRevision svnPegRevision = JavaHLObjectFactory.getSVNRevision(pegRevision);
        JavaHLPropertyHandler propHandler = new JavaHLPropertyHandler(myOwner);
        try {
            if (isURL(path)) {
                client.doGetProperty(SVNURL.parseURIEncoded(path), null, svnPegRevision, svnRevision, depth, propHandler);
            } else {
                client.doGetProperty(new File(path).getAbsoluteFile(), null, svnPegRevision, svnRevision, depth,
                        propHandler, JavaHLObjectFactory.getChangeListsCollection(changelists));
            }
        } catch (SVNException e) {
            throwException(e);
        } finally {
View Full Code Here

        propertySet(path, name, SVNPropertyValue.create(value), depth, force, changelists, revprops);
    }

    private void propertySet(String path, String name, SVNPropertyValue value, int depth, boolean force,
            String[] changelists, Map revprops) throws ClientException {
       SVNWCClient client = getSVNWCClient();
       if (isURL(path)) {
           try {
               SVNProperties revisionProperties = revprops == null ? null : SVNProperties.wrap(revprops);
               client.setCommitHandler(createCommitMessageHandler(true));
               client.doSetProperty(SVNURL.parseURIEncoded(path), name, value, SVNRevision.HEAD,
                        "", revisionProperties, force, ISVNPropertyHandler.NULL);
           } catch (SVNException e) {
               throwException(e);
           } finally {
               if (client != null) {
                   client.setCommitHandler(null);
               }
               resetLog();
           }
       } else {
           try {
               client.doSetProperty(new File(path).getAbsoluteFile(), name, value, force,
                        JavaHLObjectFactory.getSVNDepth(depth), ISVNPropertyHandler.NULL,
                        JavaHLObjectFactory.getChangeListsCollection(changelists));
           } catch (SVNException e) {
               throwException(e);
           } finally {
View Full Code Here

    public void propertyRemove(String path, String name, boolean recurse) throws ClientException {
        propertyRemove(path, name, JavaHLObjectFactory.infinityOrEmpty(recurse), null);
    }

  public void propertyRemove(String path, String name, int depth, String[] changelists) throws ClientException {
        SVNWCClient client = getSVNWCClient();
        try {
            client.doSetProperty(new File(path).getAbsoluteFile(), name, null, false,
                    JavaHLObjectFactory.getSVNDepth(depth), ISVNPropertyHandler.NULL,
                    JavaHLObjectFactory.getChangeListsCollection(changelists));
        } catch (SVNException e) {
            throwException(e);
        } finally {
View Full Code Here

    public PropertyData propertyGet(String path, String name, Revision revision, Revision pegRevision) throws ClientException {
        if (name == null || name.equals("")) {
            return null;
        }
        SVNWCClient client = getSVNWCClient();
        SVNRevision svnRevision = JavaHLObjectFactory.getSVNRevision(revision);
        SVNRevision svnPegRevision = JavaHLObjectFactory.getSVNRevision(pegRevision);
        JavaHLPropertyHandler retriever = new JavaHLPropertyHandler(myOwner);
        try {
            if (isURL(path)) {
                client.doGetProperty(SVNURL.parseURIEncoded(path), name, svnPegRevision, svnRevision, SVNDepth.EMPTY, retriever);
            } else {
                client.doGetProperty(new File(path).getAbsoluteFile(), name, svnPegRevision, svnRevision, SVNDepth.EMPTY, retriever, null);
            }
        } catch (SVNException e) {
            throwException(e);
        } finally {
            resetLog();
View Full Code Here

        SVNRevision revision = SVNRevision.UNDEFINED;

        if (getCommandLine().hasArgument(SVNArgument.REVISION)) {
            revision = SVNRevision.parse((String) getCommandLine().getArgumentValue(SVNArgument.REVISION));
        }
        SVNWCClient wcClient = getClientManager().getWCClient();
        myOut = out;
        SVNXMLSerializer serializer = new SVNXMLSerializer(myOut);
        SVNXMLInfoHandler handler = new SVNXMLInfoHandler(serializer);
        if (getCommandLine().hasArgument(SVNArgument.XML) && !getCommandLine().hasArgument(SVNArgument.INCREMENTAL)) {
            handler.startDocument();
        }
        ISVNInfoHandler infoHandler = getCommandLine().hasArgument(SVNArgument.XML) ? handler : (ISVNInfoHandler) this;
        for (int i = 0; i < getCommandLine().getPathCount(); i++) {
            myBaseFile = new File(getCommandLine().getPathAt(i));
            SVNRevision peg = getCommandLine().getPathPegRevision(i);
            handler.setTargetPath(myBaseFile);
            wcClient.doInfo(myBaseFile, peg, revision, recursive, infoHandler);
        }
        myBaseFile = null;
        for (int i = 0; i < getCommandLine().getURLCount(); i++) {
            String url = getCommandLine().getURL(i);
            SVNRevision peg = getCommandLine().getPegRevision(i);
            wcClient.doInfo(SVNURL.parseURIEncoded(url), peg, revision, recursive, infoHandler);
        }
        if (getCommandLine().hasArgument(SVNArgument.XML)&& !getCommandLine().hasArgument(SVNArgument.INCREMENTAL)) {
            handler.endDocument();
        }
        if (getCommandLine().hasArgument(SVNArgument.XML)) {
View Full Code Here

            }
            propertyValue = os.toString();
            pathIndex = 1;
        }

        SVNWCClient wcClient = getClientManager().getWCClient();

        if (revProps) {
            SVNRevision revision = SVNRevision.UNDEFINED;
            if (getCommandLine().hasArgument(SVNArgument.REVISION)) {
                revision = SVNRevision.parse((String) getCommandLine().getArgumentValue(SVNArgument.REVISION));
            }
            if (getCommandLine().hasURLs()) {
                wcClient.doSetRevisionProperty(SVNURL.parseURIEncoded(getCommandLine().getURL(0)),
                        revision, propertyName, propertyValue, force, new ISVNPropertyHandler() {
                            public void handleProperty(File path, SVNPropertyData property) throws SVNException {
                            }
                            public void handleProperty(SVNURL url, SVNPropertyData property) throws SVNException {
                                out.println("property '" + propertyName +"' set on repository revision " + url);
                            }
                            public void handleProperty(long revision, SVNPropertyData property) throws SVNException {
                            }
                });

            } else {
                File tgt = new File(".");
                if (getCommandLine().getPathCount() > 2) {
                    tgt = new File(getCommandLine().getPathAt(2));
                }
                wcClient.doSetRevisionProperty(tgt, revision, propertyName, propertyValue, force, new ISVNPropertyHandler() {
                            public void handleProperty(File path, SVNPropertyData property) throws SVNException {
                            }
                            public void handleProperty(SVNURL url, SVNPropertyData property) throws SVNException {
                                out.println("property '" + propertyName +"' set on repository revision " + url);
                            }
                            public void handleProperty(long revision, SVNPropertyData property) throws SVNException {
                            }
                });
            }

        } else {
            for (int i = pathIndex; i < getCommandLine().getPathCount(); i++) {
                final String absolutePath = getCommandLine().getPathAt(i);
                if (!recursive) {
                    wcClient.doSetProperty(new File(absolutePath), propertyName, propertyValue, force, recursive, new ISVNPropertyHandler() {
                        public void handleProperty(File path, SVNPropertyData property) throws SVNException {
                            out.println("property '" + propertyName + "' set on '" + SVNFormatUtil.formatPath(path) + "'");
                        }
                        public void handleProperty(SVNURL url, SVNPropertyData property) throws SVNException {
                        }
                        public void handleProperty(long revision, SVNPropertyData property) throws SVNException {
                        }

                    });
                } else {
                    final boolean wasSet[] = new boolean[] {false};
                    wcClient.doSetProperty(new File(absolutePath), propertyName, propertyValue, force, recursive, new ISVNPropertyHandler() {
                        public void handleProperty(File path, SVNPropertyData property) throws SVNException {
                           wasSet[0] = true;
                        }
                        public void handleProperty(SVNURL url, SVNPropertyData property) throws SVNException {
                        }
View Full Code Here

        myIsRecursive = myIsRecursive & !revProp;
        SVNRevision revision = SVNRevision.UNDEFINED;
        if (getCommandLine().hasArgument(SVNArgument.REVISION)) {
            revision = SVNRevision.parse((String) getCommandLine().getArgumentValue(SVNArgument.REVISION));
        }
        SVNWCClient wcClient = getClientManager().getWCClient();
        if (getCommandLine().hasURLs()) {
            String url = getCommandLine().getURL(0);
            if (revProp) {
                wcClient.doGetRevisionProperty(SVNURL.parseURIEncoded(url), propertyName, revision, this);
            } else {
                SVNRevision pegRevision = getCommandLine().getPegRevision(0);
                wcClient.doGetProperty(SVNURL.parseURIEncoded(url), propertyName, pegRevision, revision, myIsRecursive, this);
            }
        } else if (getCommandLine().getPathCount() > 1) {
            String path = getCommandLine().getPathAt(1);
            SVNRevision pegRevision = getCommandLine().getPathPegRevision(1);
            if (revProp) {
                wcClient.doGetRevisionProperty(new File(path), propertyName, revision, this);
            } else {
                wcClient.doGetProperty(new File(path), propertyName, pegRevision, revision, myIsRecursive, this);
            }
        }
    }
View Full Code Here

        myIsRecursive = myIsRecursive & !myIsRevProp;
        SVNRevision revision = SVNRevision.UNDEFINED;
        if (getCommandLine().hasArgument(SVNArgument.REVISION)) {
            revision = SVNRevision.parse((String) getCommandLine().getArgumentValue(SVNArgument.REVISION));
        }
        SVNWCClient wcClient = getClientManager().getWCClient();
        if (getCommandLine().hasURLs()) {
            String url = getCommandLine().getURL(0);
            if (myIsRevProp) {
                wcClient.doGetRevisionProperty(SVNURL.parseURIEncoded(url), null, revision, this);
            } else {
                SVNRevision pegRevision = getCommandLine().getPegRevision(0);
                wcClient.doGetProperty(SVNURL.parseURIEncoded(url), null, pegRevision, revision, myIsRecursive, this);
            }
        } else if (getCommandLine().getPathCount() > 0) {
            String path = getCommandLine().getPathAt(0);
            SVNRevision pegRevision = getCommandLine().getPathPegRevision(0);
            if (myIsRevProp) {
                wcClient.doGetRevisionProperty(new File(path), null, revision, this);
            } else {
                wcClient.doGetProperty(new File(path), null, pegRevision, revision, myIsRecursive, this);
            }
        }
    }
View Full Code Here

TOP

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

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.