info-cvs
[Top][All Lists]
Advanced

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

Re: Exp state on top of dead


From: Mark D. Baushke
Subject: Re: Exp state on top of dead
Date: Tue, 05 Sep 2006 10:24:50 -0700

CARTER-HITCHIN, David, GBM <address@hidden> writes:

> > I believe you are talking about the fact that
> > someone managed to have a live revision (where the
> 
> someone = me.
> 
> > state was NOT 'dead') in the Attic of its
> > directory. That is/was an observed bug in that a
> > checkout of the main trunk would not find that
> > particular file correctly.
> 
> Sorry, didn't make myself 100% clear.

Ahhh.. Right. Well, you are correct that the
current valid_repo code did not notice this
problem at present...

I have committed the patch below to find this
and related problems that might exist.

        Enjoy!
        -- Mark

ChangeLog entry:
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>.) 

Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/ChangeLog,v
retrieving revision 1.218
diff -T -u -p -r1.218 ChangeLog
--- ChangeLog   16 Aug 2006 18:12:07 -0000      1.218
+++ ChangeLog   5 Sep 2006 17:20:17 -0000
@@ -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
diff -T -u -p -r1.2 validate_repo.pl
--- validate_repo.pl    12 Mar 2006 20:38:21 -0000      1.2
+++ validate_repo.pl    5 Sep 2006 17:20:17 -0000
@@ -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 @@ sub process_file
        
                        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 process_file
        ######################################################################
        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 @@ sub look_at_cvs_file
                    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 @@ sub get_history
                        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]