Examples of TagScmResult


Examples of org.apache.maven.scm.command.tag.TagScmResult

        {
            FileUtils.fileWrite( messageFile.getAbsolutePath(), scmTagParameters.getMessage() );
        }
        catch ( IOException ex )
        {
            return new TagScmResult( null, "Error while making a temporary file for the commit message: "
                + ex.getMessage(), null, false );
        }

        try
        {
            CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

            int exitCode;

            Commandline clTag = createCommandLine( repository, fileSet.getBasedir(), tag, messageFile );

            exitCode = GitCommandLineUtils.execute( clTag, stdout, stderr, getLogger() );
            if ( exitCode != 0 )
            {
                return new TagScmResult( clTag.toString(), "The git-tag command failed.", stderr.getOutput(), false );
            }

            if( repo.isPushChanges() )
            {
                // and now push the tag to the configured upstream repository
                Commandline clPush = createPushCommandLine( repository, fileSet, tag );
   
                exitCode = GitCommandLineUtils.execute( clPush, stdout, stderr, getLogger() );
                if ( exitCode != 0 )
                {
                    return new TagScmResult( clPush.toString(), "The git-push command failed.", stderr.getOutput(), false );
                }
            }
           
            // plus search for the tagged files
            GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.TAGGED );

            Commandline clList = GitListCommand.createCommandLine( repository, fileSet.getBasedir() );

            exitCode = GitCommandLineUtils.execute( clList, listConsumer, stderr, getLogger() );
            if ( exitCode != 0 )
            {
                return new CheckOutScmResult( clList.toString(), "The git-ls-files command failed.",
                                              stderr.getOutput(), false );
            }

            return new TagScmResult( clTag.toString(), listConsumer.getListedFiles() );
        }
        finally
        {
            try
            {
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

                                                              cl.getWorkingDirectory().getAbsolutePath(), logListener,
                                                              getLogger() );

            if ( !isSuccess )
            {
                return new TagScmResult( cl.toString(), "The cvs tag command failed.",
                                         logListener.getStderr().toString(), false );
            }
            BufferedReader stream = new BufferedReader(
                new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) );

            String line;

            while ( ( line = stream.readLine() ) != null )
            {
                consumer.consumeLine( line );
            }
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            return new TagScmResult( cl.toString(), "The cvs tag command failed.", logListener.getStderr().toString(),
                                     false );
        }

        return new TagScmResult( cl.toString(), consumer.getTaggedFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

            getLog().info( "Final Tag Name: '" + finalTag + "'" );

            ScmTagParameters scmTagParameters = new ScmTagParameters( message);
            scmTagParameters.setRemoteTagging( remoteTagging );
           
            TagScmResult result = provider.tag( repository, getFileSet(), finalTag, scmTagParameters);

            checkResult( result );
        }
        catch ( IOException e )
        {
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

        CheckInScmResult checkinResult =
            getScmManager().checkIn( scmRepository, new ScmFileSet( getWorkingCopy() ), "add acignore" );

        assertResultIsSuccess( checkinResult );

        TagScmResult tagResult =
            getScmManager().getProviderByUrl( getScmUrl() ).tag( scmRepository, new ScmFileSet( getWorkingCopy() ), tag );

        assertResultIsSuccess( tagResult );

        scmRepository.getProviderRepository().setPersistCheckout( false );
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

        AccuRevTagCommand command = new AccuRevTagCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.TAG_NAME, "theTagName" );
        TagScmResult result = command.tag( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result.getTaggedFiles().size(), is( 1 ) );
        assertHasScmFile( result.getTaggedFiles(), "tagged/file", ScmFileStatus.TAGGED );

    }
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

        when( accurev.mksnap( "theTagName", basisStream ) ).thenReturn( Boolean.FALSE );
        AccuRevTagCommand command = new AccuRevTagCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.TAG_NAME, "theTagName" );
        TagScmResult result = command.tag( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( false ) );
        assertThat( result.getProviderMessage(), notNullValue() );

    }
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

        }

        if ( consumer.isSuccess() )
        {
            // Unclear what to pass as the first arg
            return new TagScmResult( "p4 label -i", consumer.getTagged() );
        }

        // Unclear what to pass as the first arg
        return new TagScmResult( "p4 label -i", "Tag failed", consumer.getOutput(), false );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

            taggedFiles = accuRev.statTag( snapshotName );
        }

        if ( success && taggedFiles != null )
        {
            return new TagScmResult( accuRev.getCommandLines(), getScmFiles( taggedFiles, ScmFileStatus.TAGGED ) );
        }
        else
        {
            return new TagScmResult( accuRev.getCommandLines(), "AccuRev error", accuRev.getErrorOutput(), false );
        }
    }
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

        List<ScmFile> files = new ArrayList<ScmFile>( fileSet.getFileList().size() );
        for ( File f : fileSet.getFileList() )
        {
            files.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
        }
        return new TagScmResult( "", files );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.tag.TagScmResult

            throw new ScmException( "Error while executing clearcase command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new TagScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false );
        }

        return new TagScmResult( cl.toString(), consumer.getCheckedInFiles() );
    }
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.