bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: A few validate_repo.pl enhancements


From: Mark D. Baushke
Subject: Re: PATCH: A few validate_repo.pl enhancements
Date: Fri, 11 Mar 2005 11:38:45 -0800

Torsten Martinsen <address@hidden> writes:

> This patch fixes two minor problems in the validate_repo.pl script:

Your patch was line wrapped. You might wish to disable line wrap when
sending patches in future e-mail.

> 1) User names containing spaces could not be parsed. (Such user names
> are relatively common in Windows environments).

Is it reasonable to exclude ';' from the author field? If so, then [^;]+
is probably better than [\S\s]+, if not then .+ is probably better.

> 2) Perl complains about an unitialized variable being used, which caused
> me to get a lot of annoying cron mail :-)

Okay.

A revised patch is provided below. Does this work for you?

        -- Mark

2005-03-11  Mark D. Baushke  <address@hidden>

        * validate_repo.in (get_history): Allow whitespace in the author
        field. Avoid uninitialized hash.
        (Problem report from "Torsten Martinsen" <address@hidden>.)

--- validate_repo.in.~1.6.~     2004-10-25 14:19:04.000000000 -0700
+++ validate_repo.in    2005-03-11 11:36:28.127009000 -0800
@@ -496,7 +496,7 @@ sub get_history
                if( $ignore == 2 )
                {
                    if( my ( $date, $author, $state ) =
-                            $line =~ /^date: (\S+ \S+);  author: (\S+);  
state: (\S+);/ )
+                            $line =~ /^date: (\S+ \S+);  author: ([^;]+);  
state: (\S+);/ )
                        {
                                $rinfo{$revision} =
                                {
@@ -700,7 +700,8 @@ sub find_interesting_revisions
                                || $max_branch_revision{$branch_number} < 
$branch_rev );
        }
 
-       push( @new_revisions, "1.1" ) unless $max_branch_revision{1} == 1;
+       push( @new_revisions, "1.1" ) unless (exists $max_branch_revision{1}
+                                             && $max_branch_revision{1} == 1);
     while( ( $key, $value ) = each ( %max_branch_revision ) )
     {
         push( @new_revisions, $key . "." . $value );




reply via email to

[Prev in Thread] Current Thread [Next in Thread]