-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfilelog-compare.pl
More file actions
executable file
·53 lines (45 loc) · 970 Bytes
/
filelog-compare.pl
File metadata and controls
executable file
·53 lines (45 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/perl -w
use strict;
use DBI;
use Scriptalicious;
my $dbh = DBI->connect("dbi:Pg:", "", "", {PrintError => 1}) or die $DBI::errstr;
do_filelog_compare($dbh);
sub do_filelog_compare {
my $dbh = shift;
my $sth = $dbh->prepare(<<SQL);
select
depotpath,
md5(depotpath)
from
(select distinct
depotpath
from
rev) x
order by
md5(depotpath)
SQL
$sth->execute;
$| = 1;
my ($ok, $total);
while ( my ($depotpath) = $sth->fetchrow_array ) {
print "\r$depotpath\e[K";
run(-out => "p4-filelog",
"p4", "filelog", $depotpath);
run(-out => "p4raw-filelog",
"git-p4raw", "filelog", $depotpath);
if ( run_err("diff", "-q", "p4-filelog", "p4raw-filelog") ) {
print "...different\n";
if ( prompt_yN("see?") ) {
system("diff", "-u", "p4-filelog", "p4raw-filelog");
}
}
else {
$ok++;
}
unless ( ++$total % 100 ) {
print " $ok / $total good\e[K\n";
}
}
print "\n";
print "checked $total files, $ok good\n";
}