private void checkResult( ScmResult result ) throws ScmException { if ( !result.isSuccess() ) { // TODO: improve error handling System.err.println( "Provider message:" ); System.err.println( result.getProviderMessage() ); System.err.println( "Command output:" ); System.err.println( result.getCommandOutput() ); throw new ScmException( "Error!" ); } }
protected void assertResultIsSuccess( ScmResult result ) { if ( result.isSuccess() ) { return; } printOutputError( result ); fail( "The command result success flag was false." ); }
protected void assertResultIsSuccess( ScmResult result ) { if ( result.isSuccess() ) { return; } printOutputError( result ); fail( "The command result success flag was false." ); }
/** {@inheritDoc} */ public List<String> validateScmUrl( String scmSpecificUrl, char delimiter ) { List<String> errorMessages = new ArrayList<String>(); String[] checkCmd = new String[]{BazaarConstants.CHECK, scmSpecificUrl}; ScmResult result; try { File tmpDir = new File( System.getProperty( "java.io.tmpdir" ) ); result = BazaarUtils.execute( tmpDir, checkCmd ); if ( !result.isSuccess() ) { errorMessages.add( result.getCommandOutput() ); errorMessages.add( result.getProviderMessage() ); } } catch ( ScmException e ) { errorMessages.add( e.getMessage() ); } return errorMessages; }
if (result.isSuccess()) { String output = result.getCommandOutput(); if (output != null) {
protected void checkResult( ScmResult result ) throws ScmException { if ( !result.isSuccess() ) { // TODO: improve error handling getLog().error( "Provider message:" ); getLog().error( result.getProviderMessage() ); getLog().error( "Command output:" ); getLog().error( result.getCommandOutput() ); throw new ScmException( "Error!" ); } }
public void checkResult( ScmResult result ) throws MojoExecutionException { if ( !result.isSuccess() ) { getLog().error( "Provider message:" ); getLog().error( result.getProviderMessage() == null ? "" : result.getProviderMessage() ); getLog().error( "Command output:" ); getLog().error( result.getCommandOutput() == null ? "" : result.getCommandOutput() ); throw new MojoExecutionException( "Command failed." + StringUtils.defaultString( result.getProviderMessage() ) ); } }
private void checkResult( ScmResult result ) throws MojoExecutionException { if ( !result.isSuccess() ) { getLog().debug( "Provider message:" ); getLog().debug( result.getProviderMessage() == null ? "" : result.getProviderMessage() ); getLog().debug( "Command output:" ); getLog().debug( result.getCommandOutput() == null ? "" : result.getCommandOutput() ); throw new MojoExecutionException( "Command failed." + StringUtils.defaultString( result.getProviderMessage() ) ); } }
/** * Check that the ScmResult was a successful operation * * @param result the SCM result. * * @throws ScmException */ private void checkScmResult(ScmResult result) throws ScmException { if (!result.isSuccess()) { throw new ScmException("Unable to commit file. " + result.getProviderMessage() + " " + (result.getCommandOutput() == null ? "" : result.getCommandOutput())); } }
/** * Check that the ScmResult was a successful operation * * @param result * @throws TransferFailedException if result was not a successful operation * @throws ScmException */ private void checkScmResult( ScmResult result ) throws ScmException { if ( !result.isSuccess() ) { throw new ScmException( "Unable to commit file. " + result.getProviderMessage() + " " + ( result.getCommandOutput() == null ? "" : result.getCommandOutput() ) ); } }
if ( result.isSuccess() )
if ( result.isSuccess() )
updateCmd ); if ( !updateResult.isSuccess() )
/** {@inheritDoc} */ protected MkdirScmResult executeMkdirCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean createInLocal ) throws ScmException { CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message ); parameters.setString( CommandParameter.BINARY, "false" ); // just invoke add command Command cmd = getAddCommand(); cmd.setLogger( getLogger() ); ScmResult addResult = cmd.execute( repository, fileSet, parameters ); if ( !addResult.isSuccess() ) { return new MkdirScmResult( addResult.getCommandLine().toString(), "The cvs command failed.", addResult.getCommandOutput(), false ); } List<ScmFile> addedFiles = new ArrayList<ScmFile>(); for ( File file : fileSet.getFileList() ) { ScmFile scmFile = new ScmFile( file.getPath(), ScmFileStatus.ADDED ); addedFiles.add( scmFile ); } return new MkdirScmResult( addResult.getCommandLine().toString(), addedFiles ); }
/** {@inheritDoc} */ protected MkdirScmResult executeMkdirCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean createInLocal ) throws ScmException { CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message ); parameters.setString( CommandParameter.BINARY, "false" ); // just invoke add command Command cmd = getAddCommand(); cmd.setLogger( getLogger() ); ScmResult addResult = cmd.execute( repository, fileSet, parameters ); if ( !addResult.isSuccess() ) { return new MkdirScmResult( addResult.getCommandLine().toString(), "The cvs command failed.", addResult.getCommandOutput(), false ); } List<ScmFile> addedFiles = new ArrayList<ScmFile>(); for ( File file : fileSet.getFileList() ) { ScmFile scmFile = new ScmFile( file.getPath(), ScmFileStatus.ADDED ); addedFiles.add( scmFile ); } return new MkdirScmResult( addResult.getCommandLine().toString(), addedFiles ); }
if ( !res.isSuccess() && ( partCOSubdir.length() == 0 || res instanceof UpdateScmResult ) )
BazaarCheckOutConsumer consumer = new BazaarCheckOutConsumer( getLogger(), checkoutDir ); ScmResult result = BazaarUtils.execute( consumer, getLogger(), checkoutDir, inventoryCmd ); if ( !result.isSuccess() )
haveRecursiveCO = recursive && res.isSuccess();
ScmResult outResult = HgUtils.execute( outConsumer, logger, workingDir, outCmd ); List<HgChangeSet> changes = outConsumer.getChanges(); if ( outResult.isSuccess() )
ScmResult outResult = HgUtils.execute( outConsumer, logger, workingDir, outCmd ); List<HgChangeSet> changes = outConsumer.getChanges(); if ( outResult.isSuccess() )