Refine search
public void addArgument( ScmFileSet f ) { info( "files: " + f.getBasedir().getAbsolutePath() ); Iterator<File> iter = f.getFileList().iterator(); while ( iter.hasNext() ) { command.createArg().setValue( ( (File) iter.next() ).getPath() ); } }
public void addArgument( ScmFileSet fileSet ) { logInfoMessage( "files: " + fileSet.getBasedir().getAbsolutePath() ); Iterator<File> iter = fileSet.getFileList().iterator(); while ( iter.hasNext() ) { fCommand.createArg().setValue( iter.next().getPath() ); } }
public void addArgument( ScmFileSet fileSet ) { logInfoMessage( "files: " + fileSet.getBasedir().getAbsolutePath() ); Iterator<File> iter = fileSet.getFileList().iterator(); while ( iter.hasNext() ) { fCommand.createArg().setValue( iter.next().getPath() ); } }
public void addArgument( ScmFileSet f ) { info( "files: " + f.getBasedir().getAbsolutePath() ); Iterator<File> iter = f.getFileList().iterator(); while ( iter.hasNext() ) { command.createArg().setValue( ( (File) iter.next() ).getPath() ); } }
public InfoScmResult executeInfoCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters, boolean recursive, String revision ) throws ScmException { SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repository; List<InfoItem> infoItems = new ArrayList<InfoItem>(); InfoScmResult svnInfoScmResult = new InfoScmResult( null, infoItems ); @SuppressWarnings( "rawtypes" ) Iterator i = fileSet.getFileList().iterator(); if ( i.hasNext() ) { while ( i.hasNext() ) { InfoItem currentItem = executeSingleInfoCommand( javaRepo, (File) ( i.next() ), revision ); infoItems.add( currentItem ); } } else { // no files just a base directory InfoItem currentItem = executeSingleInfoCommand( javaRepo, fileSet.getBasedir(), revision ); infoItems.add( currentItem ); } return svnInfoScmResult; }
protected AddScmResult executeAddFileSet(ScmFileSet fileSet) throws ScmException { File workingDirectory = fileSet.getBasedir(); List<File> files = fileSet.getFileList(); // command line can be too long for windows so add files individually (see SCM-697) if (Os.isFamily(Os.FAMILY_WINDOWS)) { for (File file : files) { AddScmResult result = executeAddFiles(workingDirectory, Collections.singletonList(file)); if (result != null) { return result; } } } else { AddScmResult result = executeAddFiles(workingDirectory, files); if (result != null) { return result; } } return null; }
private AddScmResult executeAddFileSet( ScmFileSet fileSet ) throws ScmException { File workingDirectory = fileSet.getBasedir(); List<File> files = fileSet.getFileList(); // command line can be too long for windows so add files individually (see SCM-697) if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { for ( File file : files ) { AddScmResult result = executeAddFiles( workingDirectory, Collections.singletonList( file ) ); if ( result != null ) { return result; } } } else { AddScmResult result = executeAddFiles( workingDirectory, files ); if ( result != null ) { return result; } } return null; }
private AddScmResult executeAddFileSet( ScmFileSet fileSet ) throws ScmException { File workingDirectory = fileSet.getBasedir(); List<File> files = fileSet.getFileList(); // command line can be too long for windows so add files individually (see SCM-697) if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { for ( File file : files ) { AddScmResult result = executeAddFiles( workingDirectory, Collections.singletonList( file ) ); if ( result != null ) { return result; } } } else { AddScmResult result = executeAddFiles( workingDirectory, files ); if ( result != null ) { return result; } } return null; }
/** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { //String[] addCmd = new String[] { ADD_CMD, NO_RECURSE_OPTION }; String[] addCmd = new String[] { HgCommandConstants.ADD_CMD, HgCommandConstants.VERBOSE_OPTION }; addCmd = HgUtils.expandCommandLine( addCmd, fileSet ); File workingDir = fileSet.getBasedir(); HgAddConsumer consumer = new HgAddConsumer( getLogger(), workingDir ); ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, addCmd ); AddScmResult addScmResult = new AddScmResult( consumer.getAddedFiles(), result ); // add in bogus 'added' results for empty directories. only need to do this because the maven scm unit test // framework seems to think that this is the way we should behave. it's pretty hacky. -rwd for ( File workingFile : fileSet.getFileList() ) { File file = new File( workingDir + "/" + workingFile.getPath() ); if ( file.isDirectory() && file.listFiles().length == 0 ) { addScmResult.getAddedFiles().add( new ScmFile( workingFile.getPath(), ScmFileStatus.ADDED ) ); } } return addScmResult; } }
/** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { //String[] addCmd = new String[] { ADD_CMD, NO_RECURSE_OPTION }; String[] addCmd = new String[] { HgCommandConstants.ADD_CMD, HgCommandConstants.VERBOSE_OPTION }; addCmd = HgUtils.expandCommandLine( addCmd, fileSet ); File workingDir = fileSet.getBasedir(); HgAddConsumer consumer = new HgAddConsumer( getLogger(), workingDir ); ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, addCmd ); AddScmResult addScmResult = new AddScmResult( consumer.getAddedFiles(), result ); // add in bogus 'added' results for empty directories. only need to do this because the maven scm unit test // framework seems to think that this is the way we should behave. it's pretty hacky. -rwd for ( File workingFile : fileSet.getFileList() ) { File file = new File( workingDir + "/" + workingFile.getPath() ); if ( file.isDirectory() && file.listFiles().length == 0 ) { addScmResult.getAddedFiles().add( new ScmFile( workingFile.getPath(), ScmFileStatus.ADDED ) ); } } return addScmResult; } }
public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "unco" ); command.createArg().setValue( "-keep" ); List<File> files = scmFileSet.getFileList(); for ( File file : files ) { command.createArg().setValue( file.getName() ); } return command; } }
public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "unco" ); command.createArg().setValue( "-keep" ); List<File> files = scmFileSet.getFileList(); for ( File file : files ) { command.createArg().setValue( file.getName() ); } return command; } }
public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "co" ); command.createArg().setValue( "-nc" ); List<File> files = scmFileSet.getFileList(); for ( File file : files ) { if ( logger.isInfoEnabled() ) { logger.info( "edit file: " + file.getAbsolutePath() ); } command.createArg().setValue( file.getAbsolutePath() ); } return command; }
protected static Commandline createCommandLine( SvnScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, String revision ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet.getBasedir(), repository ); cl.createArg().setValue( "info" ); if ( recursive ) { cl.createArg().setValue( "--recursive" ); } if ( StringUtils.isNotEmpty( revision ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( revision ); } Iterator<File> it = fileSet.getFileList().iterator(); while ( it.hasNext() ) { File file = (File) it.next(); if ( repository == null ) { cl.createArg().setValue( file.getPath() ); } else { cl.createArg().setValue( repository.getUrl() + "/" + file.getPath().replace( '\\', '/' ) + "@" ); } } return cl; }
public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "co" ); command.createArg().setValue( "-nc" ); List<File> files = scmFileSet.getFileList(); for ( File file : files ) { if ( logger.isInfoEnabled() ) { logger.info( "edit file: " + file.getAbsolutePath() ); } command.createArg().setValue( file.getAbsolutePath() ); } return command; }
@Override protected ScmResult executeRemoveCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message) throws ScmException { if (fileSet.getFileList().isEmpty()) { throw new ScmException("You must provide at least one file/directory to remove"); } Commandline cl = createCommandLine(fileSet.getBasedir(), fileSet.getFileList()); GitRemoveConsumer consumer = new GitRemoveConsumer(getLogger()); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute(cl, consumer, stderr, getLogger()); if (exitCode != 0) { return new RemoveScmResult(cl.toString(), "The git command failed.", stderr.getOutput(), false); } return new RemoveScmResult(cl.toString(), consumer.getRemovedFiles()); }
public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "rmname" ); command.createArg().setValue( "-nc" ); List<File> files = scmFileSet.getFileList(); for ( File file : files ) { if ( logger.isInfoEnabled() ) { logger.info( "Deleting file: " + file.getAbsolutePath() ); } command.createArg().setValue( file.getName() ); } return command; } }
public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "rmname" ); command.createArg().setValue( "-nc" ); List<File> files = scmFileSet.getFileList(); for ( File file : files ) { if ( logger.isInfoEnabled() ) { logger.info( "Deleting file: " + file.getAbsolutePath() ); } command.createArg().setValue( file.getName() ); } return command; } }
/** * {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message ) throws ScmException { if ( fileSet.getFileList().isEmpty() ) { throw new ScmException( "You must provide at least one file/directory to remove" ); } Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() ); GitRemoveConsumer consumer = new GitRemoveConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new RemoveScmResult( cl.toString(), "The git command failed.", stderr.getOutput(), false ); } return new RemoveScmResult( cl.toString(), consumer.getRemovedFiles() ); }
public static Commandline createCommandLine( ScmFileSet scmFileSet, String tag ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "mklabel" ); List<File> files = scmFileSet.getFileList(); if ( files.isEmpty() ) { command.createArg().setValue( "-recurse" ); } command.createArg().setValue( tag ); if ( files.size() > 0 ) { for ( File file : files ) { command.createArg().setValue( file.getName() ); } } else { command.createArg().setValue( "." ); } return command; }