diff options
author | Josef Karthauser <joe@FreeBSD.org> | 2002-10-17 16:29:26 +0000 |
---|---|---|
committer | Josef Karthauser <joe@FreeBSD.org> | 2002-10-17 16:29:26 +0000 |
commit | 555b7ddc316a03d0008f8278078fb85d437532d2 (patch) | |
tree | 81e31828031760128a6d418f1cf7e35120742a9f /tools | |
parent | fbfed1cf09159554a89be5e63f13cbc4a80f9ae3 (diff) | |
download | src-555b7ddc316a03d0008f8278078fb85d437532d2.tar.gz src-555b7ddc316a03d0008f8278078fb85d437532d2.zip |
Fix a bug that showed up when trying to produce a database for
subdirectories, and ended up making us loop forever.
Add the username to the md5 of the commit to make it slightly more
unique.
Make the 'cvs' run quietly.
Notes
Notes:
svn path=/head/; revision=105334
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/commitsdb/make_commit_db | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/tools/commitsdb/make_commit_db b/tools/tools/commitsdb/make_commit_db index 7b0fee780c78..d33d47806fcf 100644 --- a/tools/tools/commitsdb/make_commit_db +++ b/tools/tools/commitsdb/make_commit_db @@ -19,21 +19,21 @@ while (@dirs) { my %logs; opendir DIR, $dir or die $!; - foreach (grep { /[^\.]/ } readdir DIR) { - my $filename = "$dir/$_"; + foreach my $f (grep { /[^\.]/ } readdir DIR) { + my $filename = "$dir/$f"; if (-f $filename) { my %loghash = parse_log_message($filename); next unless %loghash; $logs{$filename} = {%loghash}; - } elsif (-d $_) { - next if /^CVS$/; - push @dirs, $_; + } elsif (-d $filename) { + next if $filename =~ /\/CVS$/; + push @dirs, $filename; } } close DIR; - # Product a database of the commits + # Produce a database of the commits foreach my $f (keys %logs) { my $file = $logs{$f}; foreach my $rev (keys %$file) { @@ -58,7 +58,7 @@ sub parse_log_message { my $file = shift; # Get a log of the file. - open LOG, "cvs -R log $file |" or die $!; + open LOG, "cvs -R log $file 2>/dev/null |" or die $!; my @log = <LOG>; my $log = join "", @log; close LOG; @@ -77,11 +77,14 @@ sub parse_log_message { my $rev = $1; # Strip off any other headers. - while ($e =~ s/^(date|branches):[^\n]*\n//sg) { + my $user; + while ($e =~ s/^(date|branches):([^\n]*)\n//sg) { + my $sub = $2; + $user = $1 if $sub =~ /author: (.*?);/; }; my $hash = string_to_hash($e); - $loghash{$rev} = $hash; + $loghash{$rev} = "$user:$hash"; } return %loghash; |