Examples of ScmException


Examples of org.apache.maven.scm.ScmException

            {
                boolean success = workingDir.mkdirs();
                if ( !success )
                {
                    String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir;
                    throw new ScmException( msg );
                }
            }
        }
        return cmd;
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            exitCode = CommandLineUtils.executeCommandLine( cmd, consumer, consumer );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Command could not be executed: " + cmd, ex );
        }
        return exitCode;
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

            }
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing clearcase command.", ex );
        }
        catch ( IOException ex )
        {
            throw new ScmException( "Error while deleting working directory.", ex );
        }

        if ( exitCode != 0 )
        {
            return new CheckOutScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
View Full Code Here

Examples of org.apache.maven.scm.ScmException

                command.createArg().setValue( canfile );
            }
        }
        catch ( IOException e )
        {
            throw new ScmException( e.getMessage(), e );
        }
        return command;
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

                }
            }
        }
        catch ( CommandLineException e )
        {
            throw new ScmException( e.getMessage(), e );
        }

        return new LoginScmResult( cl.toString(), isSuccess ? "Login successful" : "Login failed",
                                   consumer.getOutput(), isSuccess );
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            boolean success = workingDir.mkdirs();
            if ( !success )
            {
                String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir;
                throw new ScmException( msg );
            }
        }
        return cmd;
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            exitCode = CommandLineUtils.executeCommandLine( cmd, consumer, consumer );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Command could not be executed: " + cmd, ex );
        }
        return exitCode;
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        throws ScmException
    {

        if ( tag == null || StringUtils.isEmpty( tag.trim() ) )
        {
            throw new ScmException( "tag must be specified" );
        }

        if ( !fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "This provider doesn't support tagging subsets of a directory : " + fileSet.getFileList() );
        }

        File workingDir = fileSet.getBasedir();

        // build the command
        String[] tagCmd =
            new String[]{ HgCommandConstants.TAG_CMD, HgCommandConstants.MESSAGE_OPTION, scmTagParameters.getMessage(),
                tag };

        // keep the command about in string form for reporting
        StringBuilder cmd = joinCmd( tagCmd );
        HgTagConsumer consumer = new HgTagConsumer( getLogger() );
        ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, tagCmd );
        HgScmProviderRepository repository = (HgScmProviderRepository) scmProviderRepository;
        if ( result.isSuccess() )
        {
            // now push
            // Push to parent branch if any

            if ( repository.isPushChanges() )
            {
                if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) )
                {
                    String branchName = HgUtils.getCurrentBranchName( getLogger(), workingDir );
                    boolean differentOutgoingBranch =
                        HgUtils.differentOutgoingBranchFound( getLogger(), workingDir, branchName );

                    String[] pushCmd = new String[]{ HgCommandConstants.PUSH_CMD,
                        differentOutgoingBranch ? HgCommandConstants.REVISION_OPTION + branchName : null,
                        repository.getURI() };

                    result =
                        HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd );
                }
            }
        }
        else
        {
            throw new ScmException( "Error while executing command " + cmd.toString() );
        }

        // do an inventory to return the files tagged (all of them)
        String[] listCmd = new String[]{ HgCommandConstants.INVENTORY_CMD };
        HgListConsumer listconsumer = new HgListConsumer( getLogger() );
        result = HgUtils.execute( listconsumer, getLogger(), fileSet.getBasedir(), listCmd );
        if ( result.isSuccess() )
        {
            List<ScmFile> files = listconsumer.getFiles();
            List<ScmFile> fileList = new ArrayList<ScmFile>();
            for ( ScmFile f : files )
            {
                if ( !f.getPath().endsWith( ".hgtags" ) )
                {
                    fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
                }
            }

            return new TagScmResult( fileList, result );
        }
        else
        {
            throw new ScmException( "Error while executing command " + cmd.toString() );
        }
    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

        {
            String prefixStr = prefix.getCanonicalPath();
            String fileStr = file.getCanonicalPath();
            if ( !fileStr.startsWith( prefixStr ) )
            {
                throw new ScmException( prefixStr + " is not a prefix of " + fileStr );
            }
            return fileStr.substring( prefixStr.length() );
        }
        catch ( IOException e )
        {
            throw new ScmException( "IOException", e );
        }

    }
View Full Code Here

Examples of org.apache.maven.scm.ScmException

            logger.debug( "Synergy : Entering createTask method of SynergyUtil" );
        }

        if ( synopsis == null || synopsis.equals( "" ) )
        {
            throw new ScmException( "A synopsis must be specified to create a task." );
        }

        Commandline cl = SynergyCCM.createTask( synopsis, release, defaultTask, ccmAddr );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
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.