Package org.tmatesoft.svn.core.wc

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


        }
        return false;
    }

    public static void canDelete(File path, ISVNOptions options, final ISVNEventHandler eventHandler) throws SVNException {
        SVNStatusClient statusClient = new SVNStatusClient((ISVNAuthenticationManager) null, options);
        if (eventHandler != null) {
            statusClient.setEventHandler(new ISVNEventHandler() {
                public void checkCancelled() throws SVNCancelException {
                    eventHandler.checkCancelled();
                }

                public void handleEvent(SVNEvent event, double progress) throws SVNException {
                }
            });
        }
        statusClient.doStatus(path, SVNRevision.UNDEFINED, SVNDepth.INFINITY, false, false, false, false, new ISVNStatusHandler() {
            public void handleStatus(SVNStatus status) throws SVNException {
                if (status.getContentsStatus() == SVNStatusType.STATUS_OBSTRUCTED) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "''{0}'' is in the way of the resource actually under version control", status.getFile());
                    SVNErrorManager.error(err, SVNLogType.WC);
                } else if (status.getEntry() == null) {
View Full Code Here


            }
        }

        final SVNUpdateClient updateClient = userClientManager.getUpdateClient();
        if (SVNWCUtil.isVersionedDirectory(userDir)) {
            final SVNStatusClient statusClient = userClientManager.getStatusClient();
            final SVNStatus status = statusClient.doStatus(userDir, false);
            final SVNStatusType contentStatus = status.getContentsStatus();
            logger.info("(svn) status for " + userDir + " is " + contentStatus);
            if (contentStatus == SVNStatusType.STATUS_NORMAL) {
                long elapsed = -System.currentTimeMillis();
                if (logger.isDebugEnabled()) {
View Full Code Here

            SVNURL reposURL = SVNURL.fromFile(reposRoot);
            //checkout the entire repository tree
            SamplesUtility.checkOutWorkingCopy(reposURL, wcRoot);

            SVNClientManager clientManager = SVNClientManager.newInstance();
            SVNStatusClient statusClient = clientManager.getStatusClient();
            ISVNStatusHandler handler = new StatusHandler();

            statusClient.doStatus(wcRoot, SVNRevision.WORKING, SVNDepth.INFINITY, true, true, false, false,
                    handler, null);
           
            SVNWCClient wcClient = clientManager.getWCClient();
            wcClient.doSetWCFormat(wcRoot, 4);
           
            statusClient.doStatus(wcRoot, SVNRevision.WORKING, SVNDepth.INFINITY, false, true, false, false,
                    handler, null);
           
        } catch (SVNException svne) {
            System.out.println(svne.getErrorMessage());
            System.exit(1);
View Full Code Here

    private void status(String path, int depth, boolean onServer, boolean getAll, boolean noIgnore,
            boolean ignoreExternals, String[] changelists, ISVNStatusHandler handler) throws ClientException {
        if (path == null) {
            return;
        }
        SVNStatusClient stClient = getSVNStatusClient();
        boolean oldIgnoreExternals = stClient.isIgnoreExternals();
        stClient.setIgnoreExternals(ignoreExternals);
        try {
            stClient.doStatus(new File(path).getAbsoluteFile(), SVNRevision.HEAD,
                    JavaHLObjectFactory.getSVNDepth(depth), onServer, getAll, noIgnore,
                    !ignoreExternals, handler, JavaHLObjectFactory.getChangeListsCollection(changelists));
        } catch (SVNException e) {
            throwException(e);
        } finally {
            stClient.setIgnoreExternals(oldIgnoreExternals);
            resetLog();
        }
    }
View Full Code Here

            if (command != null) {
                if (SVNCommand.isForceLogCommand(commandName) && !commandLine.hasArgument(SVNArgument.FORCE_LOG)) {
                    if (commandLine.hasArgument(SVNArgument.FILE)) {
                        File file = new File((String) commandLine.getArgumentValue(SVNArgument.FILE));
                        // check if it is a versioned file.
                        SVNStatusClient stClient = new SVNStatusClient((ISVNAuthenticationManager) null, null);
                        try {
                            SVNStatus status = stClient.doStatus(file.getAbsoluteFile(), false);
                            if (status != null && status.getContentsStatus() != SVNStatusType.STATUS_UNVERSIONED &&
                                    status.getContentsStatus() != SVNStatusType.STATUS_IGNORED &&
                                    status.getContentsStatus() != SVNStatusType.STATUS_EXTERNAL) {
                                if ("lock".equals(commandName)) {
                                    System.err.println("svn: Lock comment file is a versioned file; use '--force-log' to override");
View Full Code Here

    public Status[] status(final String path, boolean descend, boolean onServer, boolean getAll, boolean noIgnore, boolean ignoreExternals) throws ClientException {
        if (path == null) {
            return null;
        }
        final Collection statuses = new ArrayList();
        SVNStatusClient stClient = getSVNStatusClient();
        boolean oldIgnoreExternals = stClient.isIgnoreExternals();
        stClient.setIgnoreExternals(ignoreExternals);
        try {
            stClient.doStatus(new File(path).getAbsoluteFile(), descend, onServer, getAll, noIgnore, !ignoreExternals, new ISVNStatusHandler(){
                public void handleStatus(SVNStatus status) {
                    statuses.add(JavaHLObjectFactory.createStatus(status.getFile().getPath(), status));
                }
            });
        } catch (SVNException e) {
            throwException(e);
        } finally {
            stClient.setIgnoreExternals(oldIgnoreExternals);
        }
        return (Status[]) statuses.toArray(new Status[statuses.size()]);
    }
View Full Code Here

    public Status singleStatus(final String path, boolean onServer) throws ClientException {
        if (path == null) {
            return null;
        }
        SVNStatusClient client = getSVNStatusClient();
        SVNStatus status = null;
        try {
            status = client.doStatus(new File(path).getAbsoluteFile(), onServer);
        } catch (SVNException e) {
            if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_DIRECTORY) {
                File file = new File(path).getAbsoluteFile();
                SVNFileType ft = SVNFileType.getType(file);
                status = new SVNStatus(null, file, ft == SVNFileType.NONE ? SVNNodeKind.NONE : SVNNodeKind.UNKNOWN, null, null, null, null,
View Full Code Here

        boolean quiet = getCommandLine().hasArgument(SVNArgument.QUIET);

        if (!getCommandLine().hasArgument(SVNArgument.XML)) {
            getClientManager().setEventHandler(new SVNCommandEventProcessor(out, err, false));
        }
        SVNStatusClient stClient = getClientManager().getStatusClient();
        ISVNStatusHandler handler = new SVNCommandStatusHandler(out, reportAll || showUpdates, reportAll, quiet, showUpdates);
        SVNXMLSerializer serializer;
        serializer = getCommandLine().hasArgument(SVNArgument.XML) ? new SVNXMLSerializer(System.out) : null;
        if (serializer != null) {
            handler = new SVNXMLStatusHandler(serializer);
            if (!getCommandLine().hasArgument(SVNArgument.INCREMENTAL)) {
                ((SVNXMLStatusHandler) handler).startDocument();
            }
        }
        boolean error = false;
        for (int i = 0; i < paths.length; i++) {
              String path = paths[i];
              if (path == null) {
                  continue;
              }
              File file = new File(path).getAbsoluteFile();
              if (serializer != null) {
                  ((SVNXMLStatusHandler) handler).startTarget(new File(getCommandLine().getPathAt(i)));
              }
              long rev = -1;
              try {
                rev = stClient.doStatus(file, recursive, showUpdates, reportAll, ignored, handler);
              } catch (SVNException e) {
                  stClient.getDebugLog().info(e);
                  err.println(e.getMessage());
                  error = true;
              }
              if (serializer != null) {
                  ((SVNXMLStatusHandler) handler).endTarget(rev);
View Full Code Here

        }
        return false;
    }

    public static void canDelete(File path, ISVNOptions options, final ISVNEventHandler eventHandler) throws SVNException {
        SVNStatusClient statusClient = new SVNStatusClient((ISVNAuthenticationManager) null, options);
        if (eventHandler != null) {
            statusClient.setEventHandler(new ISVNEventHandler() {
                public void checkCancelled() throws SVNCancelException {               
                    eventHandler.checkCancelled();
                }
                public void handleEvent(SVNEvent event, double progress) throws SVNException {
                }
            });
        }
        statusClient.doStatus(path, SVNRevision.UNDEFINED, true, false, false, false, false, new ISVNStatusHandler() {
            public void handleStatus(SVNStatus status) throws SVNException {
                if (status.getContentsStatus() == SVNStatusType.STATUS_OBSTRUCTED) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "''{0}'' is in the way of the resource actually under version control", status.getFile());
                    SVNErrorManager.error(err);
                } else if (status.getEntry() == null) {
View Full Code Here

        }
        return false;
    }

    public static void canDelete(File path, ISVNOptions options, final ISVNEventHandler eventHandler) throws SVNException {
        SVNStatusClient statusClient = new SVNStatusClient((ISVNAuthenticationManager) null, options);
        if (eventHandler != null) {
            statusClient.setEventHandler(new ISVNEventHandler() {
                public void checkCancelled() throws SVNCancelException {
                    eventHandler.checkCancelled();
                }

                public void handleEvent(SVNEvent event, double progress) throws SVNException {
                }
            });
        }
        statusClient.doStatus(path, SVNRevision.UNDEFINED, SVNDepth.INFINITY, false, false, false, false, new ISVNStatusHandler() {
            public void handleStatus(SVNStatus status) throws SVNException {
                if (status.getContentsStatus() == SVNStatusType.STATUS_OBSTRUCTED) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "''{0}'' is in the way of the resource actually under version control", status.getFile());
                    SVNErrorManager.error(err, SVNLogType.WC);
                } else if (status.getEntry() == null) {
View Full Code Here

TOP

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

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.