getLogger().debug( "Relative Path : '" + relativePath + "'" );
// Now call "scm diff on it"
// In this case, we use the DebugLoggerConsumer's ability to store captured output
DebugLoggerConsumer diffConsumer = new DebugLoggerConsumer( getLogger() );
ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
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() );