CVS status problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CVS status problem

bobby.quinne
Hi there,

I am trying to fire off a cvs status command using the netbeans cvs lib in my project. I receive the following error: " unrecognized request `'". I have done some googling but have not turned anything up.

Any assistance would be greatly appreciated. Thanks.

{code}

    private Connection getCvsConnection(ScmContext context, GlobalOptions globalProps) throws ScmException {
        File cvsRootFile = new File(context.getRootPath(), CVS_ROOT_FILE);

        Connection cvsConnection = null;
       
        try {
            String cvsRootContents = new String(FileCopyUtils.copyToByteArray(cvsRootFile));

            CVSRoot cvsRoot = CVSRoot.parse(cvsRootContents);

            globalProps.setCVSRoot(cvsRoot.toString());

            if (cvsRootContents.startsWith(PSERVER)) {
                cvsConnection = new PServerConnection(cvsRoot);
            } else {
                AbstractConnection abstractConn = new LocalConnection();
                abstractConn.setRepository(cvsRootContents);
                cvsConnection = abstractConn;
            }

            return cvsConnection;
        } catch (IOException ioException) {
            String errorMsg = String.format("Unable to load file: %s", cvsRootFile.getPath());
            LOG.error(errorMsg, ioException);

            throw new ScmException(errorMsg);
        }
    }


    public List<File> getOutOfSyncFiles(ScmContext context) throws ScmException {
        GlobalOptions globalProps = new GlobalOptions();

        Connection connection = getCvsConnection(context, globalProps);
        Client client = new Client(connection, new StandardAdminHandler());
        client.setLocalPath(context.getRootPath().getPath());

        StatusCommand cmd = new StatusCommand();
        cmd.setFiles(new File[]{context.getRootPath()});
        cmd.setRecursive(Boolean.TRUE);

        Boolean callSuccess = Boolean.FALSE;

        try {
            StatusListener listener = new StatusListener();
            client.getEventManager().addCVSListener(listener);

            callSuccess = client.executeCommand(cmd, globalProps);

            if(!callSuccess) {
                LOG.error("Unable to run 'cvs status' command.");

                throw new ScmException("Unable to run 'cvs status' command.");
            } else {
                return listener.getModifiedFiles();
            }
        } catch(CommandException commandException) {
            String errorMsg = "Unable to perform status command.";

            LOG.error(errorMsg, commandException);

            throw new ScmException(errorMsg, commandException);
        } catch(AuthenticationException authException) {
            String errorMsg = "Not authenticated against CVS server.";

            LOG.error(errorMsg, authException);

            throw new ScmException(errorMsg, authException);
        }
    }

{code}