Jul 312010
 

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
  Log:
  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
_______________________________________________
cvs-src-old@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-src-old
To unsubscribe, send any mail to "cvs-src-old-unsubscribe@freebsd.org"

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

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

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 process_cvs_mail.pl                                Index: process_cvs_mail.pl
===================================================================
RCS file: /home/repositories/freshports-1/scripts/process_cvs_mail.pl,v
retrieving revision 1.12
diff -r1.12 process_cvs_mail.pl
357a358,372
>               # 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...
>               }
>
371c386

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 del.icio.us Digg Google StumbleUpon Premium Responsive