cvs-cvs
[Top][All Lists]
Advanced

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

[Cvs-cvs] ccvs/contrib ChangeLog validate_repo.pl


From: Mark D. Baushke
Subject: [Cvs-cvs] ccvs/contrib ChangeLog validate_repo.pl
Date: Tue, 05 Sep 2006 17:23:44 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Mark D. Baushke <mdb>   06/09/05 17:23:44

Modified files:
        contrib        : ChangeLog validate_repo.pl 

Log message:
        * validate_repo.pl (look_at_cvs_file): Check for head being in
        state 'dead' outside the Attic and not dead inside the Attic.
        (get_history): Remember the head revision for later use.
        (Problem report from <address@hidden>.) 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/ChangeLog?cvsroot=cvs&r1=1.218&r2=1.219
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/validate_repo.pl?cvsroot=cvs&r1=1.2&r2=1.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/ChangeLog,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -b -r1.218 -r1.219
--- ChangeLog   16 Aug 2006 18:12:07 -0000      1.218
+++ ChangeLog   5 Sep 2006 17:23:44 -0000       1.219
@@ -1,3 +1,10 @@
+2006-09-05  Mark D. Baushke  <address@hidden>
+
+       * validate_repo.pl (look_at_cvs_file): Check for head being in
+       state 'dead' outside the Attic and not dead inside the Attic.
+       (get_history): Remember the head revision for later use.
+       (Problem report from <address@hidden>.) 
+       
 2006-08-16  Mark D. Baushke  <address@hidden>
 
        * Makefile.in, pam/Makefile.in: Regenerated.

Index: validate_repo.pl
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/validate_repo.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- validate_repo.pl    12 Mar 2006 20:38:21 -0000      1.2
+++ validate_repo.pl    5 Sep 2006 17:23:44 -0000       1.3
@@ -9,6 +9,10 @@
 #                & Ximbiot <http://ximbiot.com>.
 #  All rights reserved.
 #
+#  Some portions Copyright (c) 2006 by
+#                Mark D. Baushke <mailto:address@hidden>
+#  All rights reserved.
+#
 #  Permission is granted to copy and/or distribute this file, with or
 #  without modifications, provided this notice is preserved.
 #
@@ -358,7 +362,7 @@
 
                if( $path =~ s/,v$// )
                {
-                       look_at_cvs_file( $path );
+                       look_at_cvs_file( $path, $cvsroot );
                }
                elsif( !grep { $path =~ $_ } @ignore_files )
                {
@@ -408,10 +412,11 @@
 ######################################################################
 sub look_at_cvs_file
 {
-    my( $file ) = @_;
+    my( $file, $root ) = @_;
     my( $name, $path ) = fileparse( $file );
+    my $in_attic = ($path =~ s#Attic/$##);
 
-    $file = $path . $name if $path =~ s#Attic/$##;
+    $file = $path . $name if $in_attic;
 
     my( $finfo, $rinfo ) = get_history( $file );
 
@@ -437,6 +442,36 @@
             return();
         }
     }
+
+    # Only need to check this case if the Attic file exists.
+    if( $in_attic && -f "$root/${path}$name" )
+    {
+       verbose( "\t`$path$name AND ${path}Attic/$name BOTH exist\n");
+       push( @list_of_broken_files, $file );
+       # Do not return here, there may be more ahead.
+    }
+
+    unless( defined $$finfo{'head'})
+    {
+       verbose( "\t`$file' is corrupted. It contains no head revision\n");
+       push( @list_of_broken_files, $file )
+           unless grep ($_ eq $file, @list_of_broken_files );
+       # Do not return here, there may be more ahead.
+    }
+
+    if( $in_attic && $$rinfo{$$finfo{'head'}}{'state'} ne 'dead' )
+    {
+       verbose( "\t`$file' is corrupted. It is in the Attic and contains a 
non-dead head revision\n");
+       push( @list_of_broken_files, $file )
+           unless grep ($_ eq $file, @list_of_broken_files );
+       # Do not return here, there may be more ahead.
+    }
+    elsif( !$in_attic && $$rinfo{$$finfo{'head'}}{'state'} eq 'dead' )
+    {
+       verbose( "\t`$file' is corrupted. It is NOT in the Attic and contains a 
dead head revision\n");
+       push( @list_of_broken_files, $file )
+           unless grep ($_ eq $file, @list_of_broken_files );
+    }
 }
 
 ######################################################################
@@ -521,6 +556,13 @@
                if( $ignore == -1 )
                {
                        # Until we find the first ---- below, we can read 
general file info
+                    if( my ( $head ) =
+                            $line =~ /^head: (\S+)$/ )
+                       {
+                               $finfo{'head'} = $head;
+                               next;
+                       }
+
                    if( my ( $kwmode ) =
                             $line =~ /^keyword substitution: (\S+)$/ )
                        {




reply via email to

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