private Set<String> localChanges(Set<ScmFileStatus> statusToInclude, ScmRepository repository, File scmRoot) throws ScmException { final StatusScmResult status = this.manager.status(repository, new ScmFileSet(scmRoot)); Set<String> affected = new LinkedHashSet<>(); for (final ScmFile file : status.getChangedFiles()) { if (statusToInclude.contains(file.getStatus())) { affected.add(file.getPath()); } } return affected; }
/** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeStatusCommand( repository, fileSet ); } }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { return new StatusScmResult( null, Collections.<ScmFile>emptyList() ); } }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { return new StatusScmResult( null, Collections.<ScmFile>emptyList() ); } }
private Set<String> localChanges(Set<ScmFileStatus> statusToInclude, ScmRepository repository, File scmRoot) throws ScmException { final StatusScmResult status = this.manager.status(repository, new ScmFileSet(scmRoot)); Set<String> affected = new LinkedHashSet<>(); for (final ScmFile file : status.getChangedFiles()) { if (statusToInclude.contains(file.getStatus())) { affected.add(file.getPath()); } } return affected; }
/** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeStatusCommand( repository, fileSet ); } }
private ScmResult error( AccuRev accuRev, String message ) { return new StatusScmResult( accuRev.getCommandLines(), "AccuRev " + message, accuRev.getErrorOutput(), false ); }
public List getStatus() throws ScmException { ScmRepository repository = getScmRepository(); ScmProvider scmProvider = scmManager.getProviderByRepository( repository ); StatusScmResult result = scmProvider.status( repository, new ScmFileSet( scmDirectory ) ); checkResult( result ); return result.getChangedFiles(); }
private ScmResult error( AccuRev accuRev, String message ) { return new StatusScmResult( accuRev.getCommandLines(), "AccuRev " + message, accuRev.getErrorOutput(), false ); }
/** {@inheritDoc} */ public StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { File workingDir = fileSet.getBasedir(); HgStatusConsumer consumer = new HgStatusConsumer( getLogger(), workingDir ); String[] statusCmd = new String[] { HgCommandConstants.STATUS_CMD }; ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, statusCmd ); return new StatusScmResult( consumer.getStatus(), result ); } }
/** {@inheritDoc} */ public StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { File workingDir = fileSet.getBasedir(); HgStatusConsumer consumer = new HgStatusConsumer( getLogger(), workingDir ); String[] statusCmd = new String[] { HgCommandConstants.STATUS_CMD }; ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, statusCmd ); return new StatusScmResult( consumer.getStatus(), result ); } }
/** {@inheritDoc} */ public StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { File workingDir = fileSet.getBasedir(); BazaarStatusConsumer consumer = new BazaarStatusConsumer( getLogger(), workingDir ); String[] statusCmd = new String[] { BazaarConstants.STATUS_CMD }; ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, statusCmd ); return new StatusScmResult( consumer.getStatus(), result ); } }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet files ) throws ScmException { PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo; actualLocation = PerforceScmProvider.getRepoPath( getLogger(), prepo, files.getBasedir() ); PerforceStatusConsumer consumer = new PerforceStatusConsumer(); Commandline command = readOpened( prepo, files, consumer ); if ( consumer.isSuccess() ) { List<ScmFile> scmfiles = createResults( actualLocation, consumer ); return new StatusScmResult( command.toString(), scmfiles ); } return new StatusScmResult( command.toString(), "Unable to get status", consumer .getOutput(), consumer.isSuccess() ); }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet files ) throws ScmException { PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo; actualLocation = PerforceScmProvider.getRepoPath( getLogger(), prepo, files.getBasedir() ); PerforceStatusConsumer consumer = new PerforceStatusConsumer(); Commandline command = readOpened( prepo, files, consumer ); if ( consumer.isSuccess() ) { List<ScmFile> scmfiles = createResults( actualLocation, consumer ); return new StatusScmResult( command.toString(), scmfiles ); } return new StatusScmResult( command.toString(), "Unable to get status", consumer .getOutput(), consumer.isSuccess() ); }
/** {@inheritDoc} */ protected StatusScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsStatusConsumer consumer = new CvsStatusConsumer( getLogger(), cl.getWorkingDirectory() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); } }
/** * {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { Git git = null; try { git = JGitUtils.openRepo( fileSet.getBasedir() ); Status status = git.status().call(); List<ScmFile> changedFiles = getFileStati( status ); return new StatusScmResult( "JGit status", changedFiles ); } catch ( Exception e ) { throw new ScmException( "JGit status failure!", e ); } finally { JGitUtils.closeRepo( git ); } }
/** * {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { Git git = null; try { git = JGitUtils.openRepo( fileSet.getBasedir() ); Status status = git.status().call(); List<ScmFile> changedFiles = getFileStati( status ); return new StatusScmResult( "JGit status", changedFiles ); } catch ( Exception e ) { throw new ScmException( "JGit status failure!", e ); } finally { JGitUtils.closeRepo( git ); } }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { int exitCode; CommandLineUtils.StringStreamConsumer stderr; URI relativeRepositoryPath = getRelativeCWD( this, fileSet ); Commandline cl = createCommandLine( (GitScmProviderRepository) repo, fileSet ); GitStatusConsumer consumer = new GitStatusConsumer( getLogger(), fileSet.getBasedir(), relativeRepositoryPath ); stderr = new CommandLineUtils.StringStreamConsumer(); exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { // git-status returns non-zero if nothing to do if ( getLogger().isInfoEnabled() ) { getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" ); } } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { int exitCode; CommandLineUtils.StringStreamConsumer stderr; URI relativeRepositoryPath = getRelativeCWD( this, fileSet ); Commandline cl = createCommandLine( (GitScmProviderRepository) repo, fileSet ); GitStatusConsumer consumer = new GitStatusConsumer( getLogger(), fileSet.getBasedir(), relativeRepositoryPath ); stderr = new CommandLineUtils.StringStreamConsumer(); exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { // git-status returns non-zero if nothing to do if ( getLogger().isInfoEnabled() ) { getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" ); } } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); }
@Override protected StatusScmResult executeStatusCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException { Commandline cl = createCommandLine( (GitScmProviderRepository) repo, fileSet ); File repoRootDirectory = ScmSyncGitUtils.getRepositoryRootDirectory(fileSet.getBasedir(), getLogger()); FixedGitStatusConsumer consumer = new FixedGitStatusConsumer(getLogger(), fileSet.getBasedir(), repoRootDirectory); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if (exitCode != 0) { if (getLogger().isInfoEnabled()) { getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" ); } } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); }