Examples of DiffScmResult


Examples of org.apache.maven.scm.command.diff.DiffScmResult

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

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

        return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(),
                                  consumer.getPatch() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

        int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

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

        return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(),
                                  consumer.getPatch() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

                diffCmd = createDiffCommand( repo, fileSet, relativePath );
                int status = diffCmd.execute( diffConsumer, errConsumer );
                if ( status != 0 || errConsumer.hasBeenFed() )
                {
                    // Return a false result (not the usual SCMResult)
                    return new DiffScmResult( diffCmd.toString(), "The scm diff command failed.",
                                              errConsumer.getOutput(), false );
                }
                // Append to patch (all combined)
                patch.append( diffConsumer.getOutput() );
                // Set the differences map <File, <CharSequence>
                differences.put( relativePath, diffConsumer.getOutput() );
            }
        }

        return new DiffScmResult( diffCmd.toString(), statusCmdResult.getChangedFiles(), differences,
                                  patch.toString() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

        setAddScmResult( new AddScmResult( "", Collections.<ScmFile>emptyList() ) );
        setBranchScmResult( new BranchScmResult( "", Collections.<ScmFile>emptyList() ) );
        setChangeLogScmResult( new ChangeLogScmResult( "", "", "", true ) );
        setCheckInScmResult( new CheckInScmResult( "", "", "", true ) );
        setCheckOutScmResult( new CheckOutScmResult( "", "", "", true ) );
        setDiffScmResult( new DiffScmResult( "", "", "", true ) );
        setEditScmResult( new EditScmResult( "", "", "", true ) );
        setExportScmResult( new ExportScmResult( "", "", "", true ) );
        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
        setTagScmResult( new TagScmResult( "", "", "", true ) );
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

        Commandline clDiff2Index = createCommandLine( fileSet.getBasedir(), startVersion, endVersion, false );

        exitCode = GitCommandLineUtils.execute( clDiff2Index, consumer, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new DiffScmResult( clDiff2Index.toString(), "The git-diff command failed.", stderr.getOutput(),
                                      false );
        }

        Commandline clDiff2Head = createCommandLine( fileSet.getBasedir(), startVersion, endVersion, true );

        exitCode = GitCommandLineUtils.execute( clDiff2Head, consumer, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new DiffScmResult( clDiff2Head.toString(), "The git-diff command failed.", stderr.getOutput(), false );
        }

        return new DiffScmResult( clDiff2Index.toString(), consumer.getChangedFiles(), consumer.getDifferences(),
                                  consumer.getPatch() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

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

            if ( !isSuccess )
            {
                return new DiffScmResult( cl.toString(), "The cvs 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 DiffScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(),
                                      false );
        }

        return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(),
                                  consumer.getPatch() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

        diffCmd = BazaarUtils.expandCommandLine( diffCmd, fileSet );
        BazaarDiffConsumer consumer = new BazaarDiffConsumer( getLogger(), fileSet.getBasedir() );

        ScmResult result = BazaarUtils.execute( consumer, getLogger(), fileSet.getBasedir(), diffCmd );

        return new DiffScmResult( consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch(), result );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

            {
                getLogger().error( "CommandLineException " + e.getMessage(), e );
            }
        }

        return new DiffScmResult( cl.toString(), success ? "Diff successful" : "Unable to diff", consumer
            .getOutput(), success );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

        // Diff the project
        // ----------------------------------------------------------------------

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );
        DiffScmResult result = provider.diff( repository, fileSet, (ScmVersion) null, null );

//    todo: check asserts
//    assertNotNull("The command returned a null result.", result);

//      assertResultIsSuccess(result);

        List<ScmFile> changedFiles = result.getChangedFiles();

        Map<String, CharSequence> differences = result.getDifferences();

//    assertEquals("Expected 3 files in the changed files list "
//        + changedFiles, 3, changedFiles.size());

//    assertEquals("Expected 3 files in the differences list " + differences,
View Full Code Here

Examples of org.apache.maven.scm.command.diff.DiffScmResult

        try
        {
            ScmRepository repository = getScmRepository();

            DiffScmResult result = getScmManager().diff( repository, getFileSet(),
                                                         getScmVersion( startScmVersionType, startScmVersion ),
                                                         getScmVersion( endScmVersionType, endScmVersion ) );

            checkResult( result );

            getLog().info( result.getPatch() );

            try
            {
                if ( outputFile != null )
                {
                    FileUtils.fileWrite( outputFile.getAbsolutePath(), result.getPatch() );
                }
            }
            catch ( IOException e )
            {
                throw new MojoExecutionException( "Can't write patch file.", e );
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.