info-cvs
[Top][All Lists]
Advanced

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

WinCVS: half of the files have been 'changed'?


From: Rudolf Polzer
Subject: WinCVS: half of the files have been 'changed'?
Date: Tue, 14 May 2002 00:17:39 +0200
User-agent: slrn/0.9.7.4 (Linux)

I wanted to copy a repository from my Linux PC to some Windows PC using
a CD-R. The problem is: after extracting all file times were rounded to
a two-second boundary, which made WinCVS think half of the files have
changed.

Is there a way to tell WinCvs that it should just write the current
dates into the files? Or is there a simple Perl script?

I tried this, but I am not sure if it works reliably:



#!/usr/bin/perl

use strict;

sub Xsplit ($$)
{
 my $r = shift;
 local $_ = shift;
 my @l;
 push @l, $1
   while s/^(.*?)$r//;
 push @l, $_;
 @l;
}

for my $entry (`dir /b /s Entries` || `find -name Entries`)
{
  chomp $entry;
  (my $dir = $entry) =~ s/CVS[\\\/]Entries$//i
    or next;
  print "Entries file: $entry\n";
  open FH, "<$entry";
  open FH2, ">$entry.new";
  while (<FH>)
  {
    chomp;
    my $x = $_;
    # /.cvsignore/1.1/Sat May 11 20:42:24 2002//
    my @l = Xsplit '/', $_;
    my $date = $l[3]
      or do
      {
        print FH2 "$x\n";
        next;
      };
    my $realdate = scalar gmtime [stat "$dir$l[1]"]->[9];
    if ($date ne $realdate)
    {
      print "$l[0]: $date vs $realdate\n";
    }
    $l[3] = $realdate;
    print FH2 join ('/', @l) . "\n";
  }
  close FH;
  close FH2;
#  system 'diff',  $entry, "$entry.new";
  rename "$entry", "$entry.bak";
  rename "$entry.new", "$entry";
#  unlink "$entry.new";
}


reply via email to

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