[Buildbot-devel] change source tracking CVS tags

Matisse Enzer matisse at matisse.net
Sat Feb 2 17:19:31 UTC 2008

On Jan 30, 2008, at 3:34 AM, Bailey, Darragh wrote:

> Main problem looks to be in parsing and collecting all the changes  
> from the cvs command.
> I see the existing svnpoller uses xml logs to make parsing easier.  
> So will need to write a suitable log parser for cvs, but that  
> doesn't look too hard. I suspect it will be more difficult to  
> collate the multi-file commits as a single change entry.

I notice that the CruiseControl approach (http://cruisecontrol.sourceforge.net/main/configxml.html#cvs 
) uses a command like this:

    cvs [-d CVSROOT] -q log|rlog [-N] -d "lastbuildtime<checktime" [- 
b|-rTAG] module

Here is (I think) the Java class that CC uses to talk to a CVS  

and here is the method, parseStream() that seems to actually parse the  
output of the CVS log command:

  * Parses the input stream, which should be from the cvs log command.  
This method will format the data found in the
  * input stream into a List of Modification instances.
  * @param input
  *            InputStream to get log data from.
  * @return List of Modification elements, maybe empty never null.
  * @throws IOException
protected List parseStream(InputStream input) throws IOException {
     BufferedReader reader = new BufferedReader(new  

     // Read to the first RCS file name. The first entry in the log
     // information will begin with this line. A CVS_FILE_DELIMITER is  
     // present. If no RCS file lines are found then there is nothing  
to do.

     String line = readToNotPast(reader, CVS_RCSFILE_LINE, null);
     ArrayList mods = new ArrayList();

     while (line != null) {
         // Parse the single file entry, which may include several
         // modifications.
         List returnList = parseEntry(reader, line);

         // Add all the modifications to the local list.

         // Read to the next RCS file line. The CVS_FILE_DELIMITER may  
         // been consumed by the parseEntry method, so we cannot read  
to it.
         line = readToNotPast(reader, CVS_RCSFILE_LINE, null);

     return mods;

Matisse Enzer <matisse at matisse.net>
http://www.matisse.net/  - http://www.eigenstate.net/

More information about the devel mailing list