/** {@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 ScmResult error( AccuRev accuRev, String message ) { return new StatusScmResult( accuRev.getCommandLines(), "AccuRev " + message, accuRev.getErrorOutput(), false ); }
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 executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isInfoEnabled() ) { getLogger().info( "SVN status directory: " + fileSet.getBasedir().getAbsolutePath() ); } SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo; SvnStatusHandler handler = new SvnStatusHandler( fileSet.getBasedir() ); try { SvnJavaUtil.status( javaRepo.getClientManager(), fileSet.getBasedir(), true, // isRecursive true, // isRemote handler ); return new StatusScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles() ); } catch ( SVNException e ) { return new StatusScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN status failed.", e.getMessage(), false ); } } }
/** {@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() ); } }
protected StatusScmResult executeStatusCommand( ScmProviderRepository r, ScmFileSet f ) throws ScmException { TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r; TfsCommand command = createCommand( tfsRepo, f ); ChangedFileConsumer out = new ChangedFileConsumer( getLogger() ); ErrorStreamConsumer err = new ErrorStreamConsumer(); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new StatusScmResult( command.getCommandString(), "Error code for TFS status command - " + status, err.getOutput(), false ); } Iterator<ScmFile> iter = out.getChangedFiles().iterator(); getLogger().debug( "Iterating" ); while ( iter.hasNext() ) { ScmFile file = (ScmFile) iter.next(); getLogger().debug( file.getPath() + ":" + file.getStatus() ); } return new StatusScmResult( command.getCommandString(), out.getChangedFiles() ); }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isInfoEnabled() ) { getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() ); } if ( fileSet.getFileList().size() != 0 ) { throw new ScmException( "This provider doesn't support checking status of a subsets of a directory" ); } StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo; StarteamStatusConsumer consumer = new StarteamStatusConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); Commandline cl = createCommandLine( repository, fileSet ); int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); }
/** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isInfoEnabled() ) { getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() ); } if ( fileSet.getFileList().size() != 0 ) { throw new ScmException( "This provider doesn't support checking status of a subsets of a directory" ); } StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo; StarteamStatusConsumer consumer = new StarteamStatusConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); Commandline cl = createCommandLine( repository, fileSet ); int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The starteam 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 ); } }
@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() ); }
/** {@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() ); }
/** * 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 ) ); }