#!/usr/bin/perl
# ---------------------------------------------------------------------------------------------------
sub replace
   {
      $i = 0;
      print $_;
      while(1)
         {
            $line = <FN>;
            print $line;
            if($line =~ '^-.*\$(Revision|Log|Id|Date|Header|Author|Locker|Name|RCSfile|Source|State).*\$' )
               {
                  $line2 = <FN>;
                  if( $line2 =~ '^\+.*\$(Revision|Log|Id|Date|Header|Author|Locker|Name|RCSfile|Source|State):.*\$'){
                      $line2 = $line;
                      $line2 =~ s/-/+/;
                  }
                  print $line2;
                  return;
               }
            $i++;
            if($i>=5){return;}
         }
   }
# ---------------------------------------------------------------------------------------------------
$fn = @ARGV[0];
# ---------------------------------------------------------------------------------------------------
if(!defined($fn))
   {
      print "\nNo Filename !\n\n";
      print "usage: $0 \$filename\n\n";
      exit;
   }
# ---------------------------------------------------------------------------------------------------
open(FN,$fn);
while(<FN>)
   {
      if($_=~ "\^@@"){&replace();}
      else{print $_;}
   }
close(FN);
# ---------------------------------------------------------------------------------------------------
