ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib CVSEntry.java ChangeLogParser.java ChangeLogTask.java
Date Mon, 15 Apr 2002 12:20:52 GMT
donaldp     02/04/15 05:20:52

  Modified:    src/main/org/apache/tools/ant/taskdefs/cvslib CVSEntry.java
                        ChangeLogParser.java ChangeLogTask.java
  Log:
  Move user extraction outside of parser to please maven peeps.
  
  Revision  Changes    Path
  1.4       +6 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CVSEntry.java
  
  Index: CVSEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CVSEntry.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CVSEntry.java	14 Apr 2002 11:16:15 -0000	1.3
  +++ CVSEntry.java	15 Apr 2002 12:20:51 -0000	1.4
  @@ -61,11 +61,11 @@
    *
    * @author <a href="mailto:jeff.martin@synamic.co.uk">Jeff Martin</a>
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/04/14 11:16:15 $
  + * @version $Revision: 1.4 $ $Date: 2002/04/15 12:20:51 $
    */
   class CVSEntry {
       private Date m_date;
  -    private final String m_author;
  +    private String m_author;
       private final String m_comment;
       private final Vector m_files = new Vector();
   
  @@ -87,6 +87,10 @@
           return m_date;
       }
   
  +    void setAuthor(final String author) {
  +	m_author = author;
  +    }
  +    
       String getAuthor() {
           return m_author;
       }
  
  
  
  1.11      +1 -16     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
  
  Index: ChangeLogParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ChangeLogParser.java	15 Apr 2002 12:11:47 -0000	1.10
  +++ ChangeLogParser.java	15 Apr 2002 12:20:51 -0000	1.11
  @@ -64,7 +64,7 @@
    * A class used to parse the output of the CVS log command.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.10 $ $Date: 2002/04/15 12:11:47 $
  + * @version $Revision: 1.11 $ $Date: 2002/04/15 12:20:51 $
    */
   class ChangeLogParser {
       //private static final int GET_ENTRY = 0;
  @@ -91,17 +91,6 @@
       /** rcs entries */
       private final Hashtable m_entries = new Hashtable();
   
  -    private final Properties m_userList;
  -
  -    /**
  -     * Construct a parser that uses specified user list.
  -     *
  -     * @param userList the userlist
  -     */
  -    public ChangeLogParser(Properties userList) {
  -        m_userList = userList;
  -    }
  -
       /**
        * Get a list of rcs entrys as an array.
        *
  @@ -209,10 +198,6 @@
               m_date = line.substring(6, 25);
               String lineData = line.substring(line.indexOf(";") + 1);
               m_author = lineData.substring(10, lineData.indexOf(";"));
  -
  -            if (m_userList.containsKey(m_author)) {
  -                m_author = m_userList.getProperty(m_author);
  -            }
   
               m_status = GET_COMMENT;
   
  
  
  
  1.11      +18 -5     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
  
  Index: ChangeLogTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ChangeLogTask.java	14 Apr 2002 11:16:15 -0000	1.10
  +++ ChangeLogTask.java	15 Apr 2002 12:20:51 -0000	1.11
  @@ -100,7 +100,7 @@
    *
    * @author <a href="mailto:jeff.martin@synamic.co.uk">Jeff Martin</a>
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.10 $ $Date: 2002/04/14 11:16:15 $
  + * @version $Revision: 1.11 $ $Date: 2002/04/15 12:20:51 $
    * @since Ant 1.5
    * @ant.task name="changelog"
    */
  @@ -271,7 +271,7 @@
                   }
               }
   
  -            final ChangeLogParser parser = new ChangeLogParser(userList);
  +            final ChangeLogParser parser = new ChangeLogParser();
               final RedirectingStreamHandler handler =
                   new RedirectingStreamHandler(parser);
   
  @@ -302,6 +302,8 @@
               final CVSEntry[] entrySet = parser.getEntrySetAsArray();
               final CVSEntry[] filteredEntrySet = filterEntrySet(entrySet);
   
  +	    replaceAuthorIdWithName(userList,filteredEntrySet);
  +
               writeChangeLog(filteredEntrySet);
   
           } finally {
  @@ -309,7 +311,6 @@
           }
       }
   
  -
       /**
        * Validate the parameters specified for task.
        *
  @@ -339,7 +340,6 @@
           }
       }
   
  -
       /**
        * Load the userlist from the userList file (if specified) and add to
        * list of users.
  @@ -358,7 +358,6 @@
           }
       }
   
  -
       /**
        * Filter the specified entrys accoridn to an appropriate rule.
        *
  @@ -389,6 +388,20 @@
           return resultArray;
       }
   
  +    /**
  +     * replace all known author's id's with their maven specified names
  +     */
  +    private void replaceAuthorIdWithName(final Properties userList,
  +					 final CVSEntry[] entrySet) {
  +        for (int i = 0; i < entrySet.length; i++ ) {
  +	    
  +            final CVSEntry entry = entrySet[ i ];
  +            if (userList.containsKey(entry.getAuthor()))
  +            {
  +                entry.setAuthor(userList.getProperty(entry.getAuthor()));
  +            }
  +        }
  +    }
   
       /**
        * Print changelog to file specified in task.
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message