/** * Process the current input line in the GET_HEADER state. The * author, date, and the revision of the entry are gathered. Note, * Subversion does not have per-file revisions, instead, the entire * repository is given a single revision number, which is used for * the revision number of each file. * * @param line A line of text from the svn log output */ private void processGetHeader( String line ) { Matcher matcher = HEADER_REG_EXP.matcher( line ); if ( !matcher.matches() ) { // The header line is not found. Intentionally do nothing. return; } currentRevision = getRevision( matcher.group( REVISION_GROUP ) ); currentChange = new SvnChangeSet(); currentChange.setAuthor( matcher.group( AUTHOR_GROUP ) ); currentChange.setDate( getDate( matcher.group( DATE_GROUP ) ) ); currentChange.setRevision( currentRevision ); status = GET_FILE; }
/** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the svn log output */ private void processGetComment( String line ) { if ( line.equals( COMMENT_END_TOKEN ) ) { currentChange.setComment( currentComment.toString() ); entries.add( currentChange ); status = GET_HEADER; } else { currentComment.append( line ).append( '\n' ); } }
public void handleLogEntry( SVNLogEntry logEntry ) throws SVNException { List<ChangeFile> changedFiles = new ArrayList<ChangeFile>(); for ( String changedPath : logEntry.getChangedPaths().keySet() ) { changedFiles.add( new ChangeFile( changedPath, Long.toString( logEntry.getRevision() ) ) ); } SvnChangeSet changeSet = new SvnChangeSet( logEntry.getDate(), logEntry.getMessage(), logEntry.getAuthor(), changedFiles ); changeSet.setRevision( Long.toString( logEntry.getRevision() ) ); changeSets.add( changeSet ); }
/** {@inheritDoc} */ public boolean containsFilename( String filename, ScmProviderRepository repository ) { SvnScmProviderRepository repo = (SvnScmProviderRepository) repository; String url = repo.getUrl(); if ( !url.endsWith( "/" ) ) { url += "/"; } String currentFile = url + StringUtils.replace( filename, "\\", "/" ); if ( getFiles() != null ) { for ( Iterator<ChangeFile> i = getFiles().iterator(); i.hasNext(); ) { ChangeFile file = i.next(); if ( currentFile.endsWith( StringUtils.replace( file.getName(), "\\", "/" ) ) ) { return true; } } } return false; } }
changeFile.setOriginalName( originalName ); changeFile.setOriginalRevision( originalRev ); currentChange.addFile( changeFile );
/** {@inheritDoc} */ public boolean containsFilename( String filename, ScmProviderRepository repository ) { SvnScmProviderRepository repo = (SvnScmProviderRepository) repository; String url = repo.getUrl(); if ( !url.endsWith( "/" ) ) { url += "/"; } String currentFile = url + StringUtils.replace( filename, "\\", "/" ); if ( getFiles() != null ) { for ( Iterator<ChangeFile> i = getFiles().iterator(); i.hasNext(); ) { ChangeFile file = i.next(); if ( currentFile.endsWith( StringUtils.replace( file.getName(), "\\", "/" ) ) ) { return true; } } } return false; } }
changeFile.setOriginalName( originalName ); changeFile.setOriginalRevision( originalRev ); currentChange.addFile( changeFile );
/** * Process the current input line in the GET_HEADER state. The * author, date, and the revision of the entry are gathered. Note, * Subversion does not have per-file revisions, instead, the entire * repository is given a single revision number, which is used for * the revision number of each file. * * @param line A line of text from the svn log output */ private void processGetHeader( String line ) { Matcher matcher = HEADER_REG_EXP.matcher( line ); if ( !matcher.matches() ) { // The header line is not found. Intentionally do nothing. return; } currentRevision = getRevision( matcher.group( REVISION_GROUP ) ); currentChange = new SvnChangeSet(); currentChange.setAuthor( matcher.group( AUTHOR_GROUP ) ); currentChange.setDate( getDate( matcher.group( DATE_GROUP ) ) ); currentChange.setRevision( currentRevision ); status = GET_FILE; }
/** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the svn log output */ private void processGetComment( String line ) { if ( line.equals( COMMENT_END_TOKEN ) ) { currentChange.setComment( currentComment.toString() ); entries.add( currentChange ); status = GET_HEADER; } else { currentComment.append( line ).append( '\n' ); } }