/** * Process the current input line in the STATUS_GET_AUTHOR state. This * state gathers all of the author information that are part of a log entry. * * @param line a line of text from the git log output */ private void processGetAuthor( String line ) { // this autodetects 'raw' format if ( RAW_TREE_PATTERN.matcher( line ).matches() ) { status = STATUS_RAW_TREE; processGetRawTree( line ); return; } Matcher matcher = AUTHOR_PATTERN.matcher( line ); if ( !matcher.matches() ) { return; } String author = matcher.group( 1 ); currentChange.setAuthor( author ); status = STATUS_GET_DATE; }
/** * Process the current input line in the STATUS_RAW_AUTHOR state. This * state gathers all the author information of a log entry. * * @param line a line of text from the git log output */ private void processGetRawAuthor( String line ) { Matcher matcher = RAW_AUTHOR_PATTERN.matcher( line ); if ( !matcher.matches() ) { return; } String author = matcher.group( 1 ); currentChange.setAuthor( author ); String datestring = matcher.group( 2 ); String tz = matcher.group( 3 ); // with --format=raw option (which gets us to this methods), date is always in seconds since beginning of time // even explicit --date=iso is ignored, so we ignore both userDateFormat and GIT_TIMESTAMP_PATTERN here Calendar c = Calendar.getInstance( TimeZone.getTimeZone( tz ) ); c.setTimeInMillis( Long.parseLong( datestring ) * 1000 ); currentChange.setDate( c.getTime() ); status = STATUS_RAW_COMMITTER; }
/** * Process the current input line in the Get Author state. * * @param line a line of text from the VSS log output */ private void processGetAuthor( String line ) { String[] result = line.split( "\\s" ); Vector<String> vector = new Vector<String>(); for ( int i = 0; i < result.length; i++ ) { if ( !result[i].equals( "" ) ) { vector.add( result[i] ); } } currentChangeSet.setAuthor( vector.get( 1 ) ); currentChangeSet.setDate( parseDate( vector.get( 3 ) + " " + vector.get( 5 ), userDatePattern, "dd.MM.yy HH:mm" ) ); }
/** * Process the current input line in the STATUS_RAW_AUTHOR state. This * state gathers all the author information of a log entry. * * @param line a line of text from the git log output */ private void processGetRawAuthor( String line ) { Matcher matcher = RAW_AUTHOR_PATTERN.matcher( line ); if ( !matcher.matches() ) { return; } String author = matcher.group( 1 ); currentChange.setAuthor( author ); String datestring = matcher.group( 2 ); String tz = matcher.group( 3 ); // with --format=raw option (which gets us to this methods), date is always in seconds since beginning of time // even explicit --date=iso is ignored, so we ignore both userDateFormat and GIT_TIMESTAMP_PATTERN here Calendar c = Calendar.getInstance( TimeZone.getTimeZone( tz ) ); c.setTimeInMillis( Long.parseLong( datestring ) * 1000 ); currentChange.setDate( c.getTime() ); status = STATUS_RAW_COMMITTER; }
/** * Most of the relevant info is on the revision line matching the * 'pattern' string. * * @param line A line of text from the perforce log output */ private void processGetRevision( String line ) { Matcher matcher = REVISION_PATTERN.matcher( line ); if ( !matcher.find() ) { return; } currentChange = new ChangeSet(); currentRevision = matcher.group( 1 ); currentChange.setAuthor( matcher.group( 2 ) ); currentChange.setDate( matcher.group( 3 ), userDatePattern ); status = GET_COMMENT_BEGIN; }
/** * Process the current input line in the STATUS_GET_AUTHOR state. This * state gathers all of the author information that are part of a log entry. * * @param line a line of text from the git log output */ private void processGetAuthor( String line ) { // this autodetects 'raw' format if ( RAW_TREE_PATTERN.matcher( line ).matches() ) { status = STATUS_RAW_TREE; processGetRawTree( line ); return; } Matcher matcher = AUTHOR_PATTERN.matcher( line ); if ( !matcher.matches() ) { return; } String author = matcher.group( 1 ); currentChange.setAuthor( author ); status = STATUS_GET_DATE; }
/** * Process the current input line in the Get Author state. * * @param line a line of text from the VSS log output */ private void processGetAuthor( String line ) { String[] result = line.split( "\\s" ); Vector<String> vector = new Vector<String>(); for ( int i = 0; i < result.length; i++ ) { if ( !result[i].equals( "" ) ) { vector.add( result[i] ); } } currentChangeSet.setAuthor( vector.get( 1 ) ); currentChangeSet.setDate( parseDate( vector.get( 3 ) + " " + vector.get( 5 ), userDatePattern, "dd.MM.yy HH:mm" ) ); }
/** * Most of the relevant info is on the revision line matching the * 'pattern' string. * * @param line A line of text from the perforce log output */ private void processGetRevision( String line ) { Matcher matcher = REVISION_PATTERN.matcher( line ); if ( !matcher.find() ) { return; } currentChange = new ChangeSet(); currentRevision = matcher.group( 1 ); currentChange.setAuthor( matcher.group( 2 ) ); currentChange.setDate( matcher.group( 3 ), userDatePattern ); status = GET_COMMENT_BEGIN; }
/** * @param date Date the changes were committed * @param comment comment provided at commit time * @param author User who made changes * @param files The ChangeFile list */ public ChangeSet( Date date, String comment, String author, List<ChangeFile> files ) { setDate( date ); setAuthor( author ); setComment( comment ); this.files = files; }
/** * Most of the relevant info is on the revision line matching the * 'pattern' string. * * @param line A line of text from the perforce log output */ private void processGetRevision( String line ) { if ( line.startsWith( FILE_BEGIN_TOKEN ) ) { currentFile = line.substring( repoPath.length() + 1 ); return; } Matcher matcher = PATTERN.matcher( line ); if ( !matcher.find() ) { return; } currentChange = new ChangeSet(); currentChange.setRevision( matcher.group( 1 ) ); currentChange.setDate( parseDate( matcher.group( 3 ), userDatePattern, PERFORCE_TIMESTAMP_PATTERN ) ); currentChange.setAuthor( matcher.group( 4 ) ); status = GET_COMMENT_BEGIN; }
/** * @param date Date the changes were committed * @param comment comment provided at commit time * @param author User who made changes * @param files The ChangeFile list */ public ChangeSet( Date date, String comment, String author, List<ChangeFile> files ) { setDate( date ); setAuthor( author ); setComment( comment ); this.files = files; }
/** * Process the current input line in the Get Date state. * * @param line a line of text from the cvs log output */ private void processGetDate( String line ) { if ( line.startsWith( DATE_TAG ) ) { StringTokenizer tokenizer = new StringTokenizer( line, ";" ); // date: YYYY/mm/dd HH:mm:ss [Z]; author: name;... String datePart = tokenizer.nextToken().trim(); String dateTime = datePart.substring( "date: ".length() ); StringTokenizer dateTokenizer = new StringTokenizer( dateTime, " " ); if ( dateTokenizer.countTokens() == 2 ) { dateTime += " UTC"; } getCurrentChange().setDate( dateTime, userDatePattern ); String authorPart = tokenizer.nextToken().trim(); String author = authorPart.substring( "author: ".length() ); getCurrentChange().setAuthor( author ); setStatus( GET_COMMENT ); } }
/** * Most of the relevant info is on the revision line matching the * 'pattern' string. * * @param line A line of text from the perforce log output */ private void processGetRevision( String line ) { if ( line.startsWith( FILE_BEGIN_TOKEN ) ) { currentFile = line.substring( repoPath.length() + 1 ); return; } Matcher matcher = PATTERN.matcher( line ); if ( !matcher.find() ) { return; } currentChange = new ChangeSet(); currentChange.setRevision( matcher.group( 1 ) ); currentChange.setDate( parseDate( matcher.group( 3 ), userDatePattern, PERFORCE_TIMESTAMP_PATTERN ) ); currentChange.setAuthor( matcher.group( 4 ) ); status = GET_COMMENT_BEGIN; }
/** * Process the current input line in the Get Date state. * * @param line a line of text from the cvs log output */ private void processGetDate( String line ) { if ( line.startsWith( DATE_TAG ) ) { StringTokenizer tokenizer = new StringTokenizer( line, ";" ); // date: YYYY/mm/dd HH:mm:ss [Z]; author: name;... String datePart = tokenizer.nextToken().trim(); String dateTime = datePart.substring( "date: ".length() ); StringTokenizer dateTokenizer = new StringTokenizer( dateTime, " " ); if ( dateTokenizer.countTokens() == 2 ) { dateTime += " UTC"; } getCurrentChange().setDate( dateTime, userDatePattern ); String authorPart = tokenizer.nextToken().trim(); String author = authorPart.substring( "author: ".length() ); getCurrentChange().setAuthor( author ); setStatus( GET_COMMENT ); } }
/** * Process the current input line in the Get Date state. * * @param line a line of text from the cvs log output */ private void processGetDate( String line ) { if ( line.startsWith( DATE_TAG ) ) { StringTokenizer tokenizer = new StringTokenizer( line, " ;" ); // date: YYYY/mm/dd HH:mm:ss; author: name tokenizer.nextToken(); // date tag String date = tokenizer.nextToken(); String time = tokenizer.nextToken(); getCurrentChange().setDate( date + " " + time ); tokenizer.nextToken(); // author tag // assumes author can't contain spaces String author = tokenizer.nextToken(); getCurrentChange().setAuthor( author ); setStatus( GET_COMMENT ); } }
/** * Process the current input line in the Get Author/Date state. * * @param line a line of text from the Starteam log output */ private void processGetAuthor( String line ) { if ( line.startsWith( AUTHOR_TAG ) ) { int posDateTag = line.indexOf( DATE_TAG ); String author = line.substring( AUTHOR_TAG.length(), posDateTag ); getCurrentChange().setAuthor( author ); String date = line.substring( posDateTag + DATE_TAG.length() ); Date dateObj = parseDate( date, userDateFormat, localFormat.toPattern() ); if ( dateObj != null ) { getCurrentChange().setDate( dateObj ); } else { getCurrentChange().setDate( date, userDateFormat ); } setStatus( GET_COMMENT ); } }
/** * Process the current input line in the Get Author/Date state. * * @param line a line of text from the Starteam log output */ private void processGetAuthor( String line ) { if ( line.startsWith( AUTHOR_TAG ) ) { int posDateTag = line.indexOf( DATE_TAG ); String author = line.substring( AUTHOR_TAG.length(), posDateTag ); getCurrentChange().setAuthor( author ); String date = line.substring( posDateTag + DATE_TAG.length() ); Date dateObj = parseDate( date, userDateFormat, localFormat.toPattern() ); if ( dateObj != null ) { getCurrentChange().setDate( dateObj ); } else { getCurrentChange().setDate( date, userDateFormat ); } setStatus( GET_COMMENT ); } }
/** * Process the current input line in the Get Comment state. * * @param line a line of text from the clearcase log output */ private void processGetCommentAndUser( String line ) { if ( line.startsWith( COMMENT_TAG ) ) { String comm = line.substring( COMMENT_TAG.length() ); getCurrentChange().setComment( getCurrentChange().getComment() + comm + "\n" ); } else if ( line.startsWith( USER_TAG ) ) { getCurrentChange().setAuthor( line.substring( USER_TAG.length() ) ); // add entry, and set state to get file getCurrentChange().addFile( getCurrentFile() ); entries.add( getCurrentChange() ); setStatus( GET_REVISION ); } else { // keep gathering comments getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" ); } }
/** * Process the current input line in the Get Comment state. * * @param line a line of text from the clearcase log output */ private void processGetCommentAndUser( String line ) { if ( line.startsWith( COMMENT_TAG ) ) { String comm = line.substring( COMMENT_TAG.length() ); getCurrentChange().setComment( getCurrentChange().getComment() + comm + "\n" ); } else if ( line.startsWith( USER_TAG ) ) { getCurrentChange().setAuthor( line.substring( USER_TAG.length() ) ); // add entry, and set state to get file getCurrentChange().addFile( getCurrentFile() ); entries.add( getCurrentChange() ); setStatus( GET_REVISION ); } else { // keep gathering comments getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" ); } }
currentChangeSet.setAuthor( author ); currentChangeSet.setComment( comment );