Package org.apache.maven.scm.provider.integrity.repository

Examples of org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository


    public ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive,
                                             ScmVersion scmVersion )
        throws ScmException
    {
        ListScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        getLogger().info( "Listing all files in project " + iRepo.getConfigruationPath() );
        try
        {
            // Get a listing for all the members in the project...
            List<Member> projectMembers = iRepo.getProject().listFiles( fileSet.getBasedir().getAbsolutePath() );
            // Initialize the list of ScmFile objects for the ListScmResult
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
            {
                Member siMember = it.next();
View Full Code Here


        {
            throw new ScmException( "A single filename is required to execute the unlock command!" );
        }

        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            File memberFile = new File( workingDirectory.getAbsoluteFile() + File.separator + filename );
            Response res = siSandbox.unlock( memberFile, filename );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
View Full Code Here

    @Override
    public StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        StatusScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        getLogger().info( "Status of files changed in sandbox " + fileSet.getBasedir().getAbsolutePath() );
        try
        {
            // Initialize the list of ScmFile objects for the StatusScmResult
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();

            // Get a listing for all the changes in the sandbox
            Sandbox siSandbox = iRepo.getSandbox();
            // Get the excludes and includes list from the configuration
            String excludes = Sandbox.formatFilePatterns( fileSet.getExcludes() );
            String includes = Sandbox.formatFilePatterns( fileSet.getIncludes() );

            // Get the new members found in the sandbox
View Full Code Here

    public DiffScmResult executeDiffCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                             ScmVersion startRevision, ScmVersion endRevision )
        throws ScmException
    {
        DiffScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        getLogger().info( "Showing differences bettween local files in " + fileSet.getBasedir().getAbsolutePath()
                              + " and server project " + iRepo.getConfigruationPath() );

        // Since the si diff command is not completely API ready, we will use the CLI for this command
        Commandline shell = new Commandline();
        shell.setWorkingDirectory( fileSet.getBasedir() );
        shell.setExecutable( "si" );
View Full Code Here

    public EditScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        getLogger().info( "Attempting make files writeable in Sandbox " + fileSet.getBasedir().getAbsolutePath() );
        EditScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.makeWriteable();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new EditScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
View Full Code Here

        exportDir =
            ( ( null != exportDir && exportDir.length() > 0 ) ? exportDir : fileSet.getBasedir().getAbsolutePath() );
        // Let the user know where we're going to be exporting the files...
        getLogger().info( "Attempting to export files to " + exportDir );
        ExportScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            // Lets set our overall export success flag
            boolean exportSuccess = true;
            // Perform a fresh checkout of each file in the member list...
            List<Member> projectMembers = iRepo.getProject().listFiles( exportDir );
            // Initialize the list of files we actually exported...
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
            {
                Member siMember = it.next();
                try
                {
                    getLogger().info( "Attempting to export file: " + siMember.getTargetFilePath() + " at revision "
                                          + siMember.getRevision() );
                    siMember.checkout( iRepo.getAPISession() );
                    scmFileList.add( new ScmFile( siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN ) );
                }
                catch ( APIException ae )
                {
                    exportSuccess = false;
View Full Code Here

        {
            throw new ScmException( "A relative directory path is required to execute this command!" );
        }
        getLogger().info( "Creating subprojects one per directory, as required for " + dirPath );
        MkdirScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Response res = iRepo.getSandbox().createSubproject( dirPath );
            String subProject = res.getWorkItems().next().getResult().getField( "resultant" ).getItem().getDisplayId();
            List<ScmFile> createdDirs = new ArrayList<ScmFile>();
            createdDirs.add( new ScmFile( subProject, ScmFileStatus.ADDED ) );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
View Full Code Here

    public CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                     ScmVersion scmVersion, boolean recursive )
        throws ScmException
    {
        CheckOutScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            getLogger().info(
                "Attempting to checkout source for project " + iRepo.getProject().getConfigurationPath() );
            String checkoutDir = System.getProperty( "checkoutDirectory" );
            // Override the sandbox definition, if a checkout directory is specified for this command
            Sandbox siSandbox;
            if ( null != checkoutDir && checkoutDir.length() > 0 )
            {
                siSandbox = new Sandbox( iRepo.getAPISession(), iRepo.getProject(), checkoutDir );
                iRepo.setSandbox( siSandbox );
            }
            else
            {
                siSandbox = iRepo.getSandbox();
            }
            getLogger().info( "Sandbox location is " + siSandbox.getSandboxDir() );
            // Now attempt to create the sandbox, if it doesn't already exist
            if ( siSandbox.create() )
            {
View Full Code Here

    public BranchScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                 String branchName, String message )
        throws ScmException
    {
        BranchScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        Project siProject = iRepo.getProject();
        getLogger().info(
            "Attempting to branch project " + siProject.getProjectName() + " using branch name '" + branchName + "'" );
        try
        {
            Project.validateTag( branchName );
View Full Code Here

                                                 ScmVersion scmVersion )
        throws ScmException
    {
        getLogger().info( "Attempting to synchronize sandbox in " + fileSet.getBasedir().getAbsolutePath() );
        List<ScmFile> updatedFiles = new ArrayList<ScmFile>();
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        Sandbox siSandbox = iRepo.getSandbox();
        try
        {
            // Make sure we've got a valid sandbox, otherwise create it...
            if ( siSandbox.create() )
            {
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository

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.