/** {@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 ); }
public void testMkdirCommandMkdirLocal() throws Exception { ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( getMissingDirectory() ) ); MkdirScmResult result = getScmManager().mkdir( getScmRepository(), fileSet, null, true ); assertResultIsSuccess( result ); assertNotNull( result.getCreatedDirs() ); assertTrue( "Directory should have been added.", 1 == result.getCreatedDirs().size() ); }
public void testMkdirCommandDirAlreadyAdded() throws Exception { ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( getMissingDirectory() ) ); MkdirScmResult result = getScmManager().mkdir( getScmRepository(), fileSet, null, false ); assertResultIsSuccess( result ); assertNotNull( result.getRevision() ); ListScmResult listResult = getScmManager().list( getScmRepository(), fileSet, true, null ); assertTrue( "Directory should have been found.", listResult.isSuccess() ); // add the directory again result = getScmManager().mkdir( getScmRepository(), fileSet, null, false ); printOutputError( result ); assertFalse( result.isSuccess() ); } }
public void testMkdirCommandMkdirUrl() throws Exception { ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( getMissingDirectory() ) ); MkdirScmResult result = getScmManager().mkdir( getScmRepository(), fileSet, "Mkdir message", false ); assertResultIsSuccess( result ); assertNotNull( result.getRevision() ); ListScmResult listResult = getScmManager().list( getScmRepository(), fileSet, true, null ); assertTrue( "Directory should have been found.", listResult.isSuccess() ); }
return new MkdirScmResult( null, "Directory already exists!", "Directory already exists.", false ); if ( repo.isFileAdded( path ) ) return new MkdirScmResult( null, "Directory already exists!", "Directory already exists.", false ); return new MkdirScmResult( null, createdDirs );
public void testMkdirCommandMkdirLocal() throws Exception { ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( getMissingDirectory() ) ); MkdirScmResult result = getScmManager().mkdir( getScmRepository(), fileSet, null, true ); assertResultIsSuccess( result ); assertNotNull( result.getCreatedDirs() ); assertTrue( "Directory should have been added.", 1 == result.getCreatedDirs().size() ); }
return new MkdirScmResult( null, "Directory already exists!", "Directory already exists.", false ); if ( repo.isFileAdded( path ) ) return new MkdirScmResult( null, "Directory already exists!", "Directory already exists.", false ); return new MkdirScmResult( null, createdDirs );
ScmResult scmResult = new ScmResult( null, null, null, true ); return new MkdirScmResult( Long.toString( commitInfo.getNewRevision() ), scmResult );
/** {@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 ); }
return new MkdirScmResult( null, "Error while making a temporary file for the mkdir message: " + ex.getMessage(), null, false ); return new MkdirScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); return new MkdirScmResult( cl.toString(), consumer.getCreatedDirs() ); return new MkdirScmResult( cl.toString(), Integer.toString( consumer.getRevision() ) );
return new MkdirScmResult( null, "Error while making a temporary file for the mkdir message: " + ex.getMessage(), null, false ); return new MkdirScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); return new MkdirScmResult( cl.toString(), consumer.getCreatedDirs() ); return new MkdirScmResult( cl.toString(), Integer.toString( consumer.getRevision() ) );
boolean success = ( exitCode == 0 ? true : false ); getLogger().info( "Successfully created subproject " + subProject ); result = new MkdirScmResult( createdDirs, new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success ) ); getLogger().error( "MKS API Exception: " + eh.getMessage() ); getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() ); result = new MkdirScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
boolean success = ( exitCode == 0 ? true : false ); getLogger().info( "Successfully created subproject " + subProject ); result = new MkdirScmResult( createdDirs, new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success ) ); getLogger().error( "MKS API Exception: " + eh.getMessage() ); getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() ); result = new MkdirScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
/** * Create a new ScmProviderStub with bogus (not null) attributes */ public ScmProviderStub() { setScmSpecificFilename( "" ); 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 ) ); setUnEditScmResult( new UnEditScmResult( "", "", "", true ) ); setUpdateScmResult( new UpdateScmResult( "", "", "", true ) ); setBlameScmResult( new BlameScmResult( "", "", "", true ) ); setMkdirScmResult( new MkdirScmResult( "", "", "", true ) ); }
/** * Create a new ScmProviderStub with bogus (not null) attributes */ public ScmProviderStub() { setScmSpecificFilename( "" ); 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 ) ); setUnEditScmResult( new UnEditScmResult( "", "", "", true ) ); setUntagScmResult( new UntagScmResult( "", "", "", true ) ); setUpdateScmResult( new UpdateScmResult( "", "", "", true ) ); setBlameScmResult( new BlameScmResult( "", "", "", true ) ); setMkdirScmResult( new MkdirScmResult( "", "", "", true ) ); }