Next: , Previous: Parsing Email Change Messages, Up: Mail-parsing ChangeSources CVSMaildirSource

This parser works with the script in the contrib directory.

The script sends an email containing all the files submitted in one directory. It is invoked by using the CVSROOT/loginfo facility.

The Buildbot's CVSMaildirSource knows how to parse these messages and turn them into Change objects. It takes two parameters, the directory name of the maildir root, and an optional function to create a URL for each file. The function takes three parameters:

      file   - file name
      oldRev - old revision of the file
      newRev - new revision of the file

It must return, oldly enough, a url for the file in question. For example:

     def fileToUrl( file, oldRev, newRev ):
         return '' + file + '?rev=' + newRev
     from buildbot.changes.mail import CVSMaildirSource
     c['change_source'] = CVSMaildirSource("/home/buildbot/Mail", urlmaker=fileToUrl)

Configuration of CVS and

CVS must be configured to invoke the script when files are checked in. This is done via the CVS loginfo configuration file.

To update this, first do:

     cvs checkout CVSROOT

cd to the CVSROOT directory and edit the file loginfo, adding a line like:

     SomeModule /cvsroot/CVSROOT/ --cvsroot -e buildbot -P SomeModule %{sVv}

NOTE: For cvs version 1.12.x, the '--path %p' option is required. Version 1.11.x and 1.12.x report the directory path differently.

The above example you put the script under /cvsroot/CVSROOT. It can be anywhere. Run the script with –help to see all the options. At the very least, the options -e (email) and -P (project) should be specified. The line must end with %{sVv} This is expanded to the files that were modified.

Additional entries can be added to support more modules.

The following is an abreviated form of –help

         buildbot-cvs-mail [options] %{sVv}
     Where options are:
             Catagory for change. This becomes the Change.cagatory attribute.
             This may not make sense to specify it here, as category is meant
             to distinguish the diffrent types of bots inside a same project,
             such as "test", "docs", "full"
             CVSROOT for use by buildbot slaves to checkout code.
             This becomes the Change.repository attribute.
             Exmaple: :ext:myhost:/cvsroot
         -e email
             Email address of the buildbot.
         -f hostname
             The hostname that email messages appear to be coming from.  The From:
             header of the outgoing message will look like user@hostname.  By
             default, hostname is the machine's fully qualified domain name.
         --help / -h
             Print this text.
         -m hostname
             The hostname of an available SMTP server.  The default is
             The port number of SMTP server.  The default is '25'.
         --quiet / -q
             Don't print as much status to stdout.
         -p path
             The path for the files in this update. This comes from the %p parameter
             in loginfo for CVS version 1.12.x. Do not use this for CVS version 1.11.x
         -P project
             The project for the source. Use the CVS module being modified. This
             becomes the Change.project attribute.
         -R ADDR
           Add a "Reply-To: ADDR" header to the email message.
           Construct message and send to stdout for testing
     The rest of the command line arguments are:
             CVS %{sVv} loginfo expansion.  When invoked by CVS, this will be a single
             string containing the files that are changing.