Examples of BlameScmResult


Examples of org.apache.maven.scm.command.blame.BlameScmResult

        List<BlameLine> lines = accuRev.annotate( fileSet.getBasedir(), file );

        if ( lines != null )
        {
            return new BlameScmResult( accuRev.getCommandLines(), lines );
        }
        else
        {
            return new BlameScmResult( accuRev.getCommandLines(), "AccuRev Error", accuRev.getErrorOutput(), false );
        }

    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

        getLogger().info( "Attempting to display blame results for file: " + filename );
        if ( null == filename || filename.length() == 0 )
        {
            throw new ScmException( "A single filename is required to execute the blame command!" );
        }
        BlameScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        // Since the si annotate command is not completely API ready, we will use the CLI for this command
        Commandline shell = new Commandline();
        shell.setWorkingDirectory( workingDirectory.getBasedir() );
        shell.setExecutable( "si" );
        shell.createArg().setValue( "annotate" );
        shell.createArg().setValue( "--hostname=" + api.getHostName() );
        shell.createArg().setValue( "--port=" + api.getPort() );
        shell.createArg().setValue( "--user=" + api.getUserName() );
        shell.createArg().setValue( "--fields=date,revision,author" );
        shell.createArg().setValue( '"' + filename + '"' );
        IntegrityBlameConsumer shellConsumer = new IntegrityBlameConsumer( getLogger() );

        try
        {
            getLogger().debug( "Executing: " + shell.getCommandline() );
            int exitCode = CommandLineUtils.executeCommandLine( shell, shellConsumer,
                                                                new CommandLineUtils.StringStreamConsumer() );
            boolean success = ( exitCode == 128 ? false : true );
            ScmResult scmResult =
                new ScmResult( shell.getCommandline().toString(), "", "Exit Code: " + exitCode, success );
            return new BlameScmResult( shellConsumer.getBlameList(), scmResult );
        }
        catch ( CommandLineException cle )
        {
            getLogger().error( "Command Line Exception: " + cle.getMessage() );
            result = new BlameScmResult( shell.getCommandline().toString(), cle.getMessage(), "", false );
        }

        return result;
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

                                          blameResult.getSourceCommit( i ).getName(),
                                          blameResult.getSourceAuthor( i ).getName(),
                                          blameResult.getSourceCommitter( i ).getName() ) );
            }

            return new BlameScmResult( "JGit blame", lines );
        }
        catch ( Exception e )
        {
            throw new ScmException( "JGit blame failure!", e );
        }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

        {
            throw new ScmException( "Error while executing command.", ex );
        }
        if ( exitCode != 0 )
        {
            return new BlameScmResult( cl.toString(), "The tfs command failed.", stderr.getOutput(), false );
        }

        return new BlameScmResult( cl.toString(), consumer.getLines() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

        {
            throw new ScmException( "Error while executing command.", ex );
        }
        if ( exitCode != 0 )
        {
            return new BlameScmResult( cl.toString(), "The perforce command failed.", stderr.getOutput(), false );
        }

        // Call filelog command

        cl =
            createFilelogCommandLine( (PerforceScmProviderRepository) repo, workingDirectory.getBasedir(), filename,
                                      clientspec );

        PerforceFilelogConsumer filelogConsumer = new PerforceFilelogConsumer( getLogger() );

        try
        {
            exitCode = CommandLineUtils.executeCommandLine( cl, filelogConsumer, stderr );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing command.", ex );
        }
        if ( exitCode != 0 )
        {
            return new BlameScmResult( cl.toString(), "The perforce command failed.", stderr.getOutput(), false );
        }

        // Combine results

        List<BlameLine> lines = blameConsumer.getLines();
        for ( int i = 0; i < lines.size(); i++ )
        {
            BlameLine line = lines.get( i );
            String revision = line.getRevision();
            line.setAuthor( filelogConsumer.getAuthor( revision ) );
            line.setDate( filelogConsumer.getDate( revision ) );
        }

        return new BlameScmResult( cl.toString(), lines );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
        setTagScmResult( new TagScmResult( "", "", "", true ) );
        setUnEditScmResult( new UnEditScmResult( "", "", "", true ) );
        setUpdateScmResult( new UpdateScmResult( "", "", "", true ) );
        setBlameScmResult( new BlameScmResult( "", "", "", true ) );
        setMkdirScmResult( new MkdirScmResult( "", "", "", true ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

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

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

        return new BlameScmResult( cl.toString(), consumer.getLines() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

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

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

        return new BlameScmResult( cl.toString(), consumer.getLines() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

            "--date",   // list the date
            "--number", // list the revision number
            filename};
        HgBlameConsumer consumer = new HgBlameConsumer( getLogger() );
        ScmResult result = HgUtils.execute( consumer, getLogger(), workingDirectory.getBasedir(), cmd );
        return new BlameScmResult( consumer.getLines(), result );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameScmResult

        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
        setTagScmResult( new TagScmResult( "", "", "", true ) );
        setUnEditScmResult( new UnEditScmResult( "", "", "", true ) );
        setUpdateScmResult( new UpdateScmResult( "", "", "", true ) );
        setBlameScmResult( new BlameScmResult( "", "", "", true ) );
        setMkdirScmResult( new MkdirScmResult( "", "", "", true ) );
    }
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.