Commit email problems

Today I found a new issue with commit emails. They aren’t perfect. Neither is the code.

The problem arose with this email:

philip      2010-07-31 14:57:38 UTC

  FreeBSD src repository

  Modified files:
    .                    access mentors
  SVN rev 210685 on 2010-07-31 14:57:38Z by philip

  Take cbzimmer's commit bit into safekeeping per his request.

  Approved by:    core

  Revision  Changes    Path
  1.941                CVSROOT/access
  1.85      +0 -1      CVSROOT/mentors
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

I found something in the retry queue, along with some errors. Looking at the XML, I found:

  <FILE Revision="1.941" Action="Modify" Path="" Changes="CVSROOT/access "></FILE>
  <FILE Revision="1.85" Action="Modify" Path="CVSROOT/mentors" Changes="+0 -1"></FILE>

As you can see, the Path in the first line is empty, and the Changes field contains the path.

Looking at the email, you can see the changes field is empty. Looking at the code, I see this:

my ($revision, $changes1, $changes2, $path, $action) = split(" ", $line);

Now, I could do fixed field on this line, but I’m not. Thus, the path field gets the changes1 field, and $action, if supplied, is in $change2.

$ cvs di                                Index:
RCS file: /home/repositories/freshports-1/scripts/,v
retrieving revision 1.12
diff -r1.12
>               # sometimes changes1 and change2 are empty in the data.  In which case, we need to
>               # move what is in Changes, into path...
>               #
>               if (($changes1 ne '') && !defined($path)) {
>                       $path     = $changes1;
>                       if (defined($changes2)) {
>                               $action = $changes2;
>                       }
>                       $changes1 = '0';
>                       $changes2 = '0';
>                       # now... if $changes2 is set, that's probably the action field...
>               }

Now the XML looks like

<FILE Revision="1.941" Action="Modify" Path="CVSROOT/access" Changes="0 0"></FILE>
Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top