💾 Archived View for d.moonfire.us › blog › 2012 › 04 › 28 › an-obsession-with-data-subversion-editio… captured on 2024-07-09 at 02:13:12. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-04-26)
-=-=-=-=-=-=-
use strict; use warnings;
my $last_timestamp = “undef”; my %files = ();
while () { # Clean up the line and ignore blanks. chomp; next if /^s*$/; # In general, we will have two types of lines. One is in a # timestamp and the other is the name of the file. # rd+ | user | 2010-07-10 21:45:57 -0500 (Sat, 10 Jul 2010) | 1 line if (/(d+)-(d+)-(d+) (d+):(d+):(d+)/) { # We only care about the date of the check-in. $last_timestamp = “$1-$2-$3”; } else { # For everything else, we get a filename. There are a few # things that we frequently ignore, such as hidden files # (start with a period). s/^s+//sg; unless (/^(M|A|D)s+(.*?)$/) { # An unkown line, so skip it. next; }
# We add the file and the current timestamp to the # hash. Since we replace with each one, and `git log` goes # backwards in time, the last time we see the file is the # point it was first added to the repository. # Print out the line. my $file = $2; $file =~ s/s*(.*?$//; $files{$file} = $last_timestamp; }
}
open REPORT, “>svn.files” or die "Cannot write svn.files ($!)";
foreach my $file (sort(keys(%files))) { # Pull out the date. my $date = $files{$file}; # Keep track if this file exists. my $exists = 0; # They don't exist in this case $exists = 1 if -f “$dir/$file”;
#print "$filet$daten"; #print "$datet$existst$filen";
print REPORT “$filet$existst$daten”; }
close REPORT;
Categories:
Tags:
Below are various useful links within this site and to related sites (not all have been converted over to Gemini).
https://d.moonfire.us/blog/2012/04/28/an-obsession-with-data-subversion-edition/