Skip to content
Browse files

Add the checking scripts

These are the scripts I'm using to check that the
output of the p4raw and p4 'integed' and 'integrated'
commands is the same.
  • Loading branch information...
1 parent 97afb71 commit 666298752e0701713b02de1154fb956020a2711a @samv committed
Showing with 106 additions and 0 deletions.
  1. +53 −0 filelog-compare.pl
  2. +53 −0 integed-compare.pl
View
53 filelog-compare.pl
@@ -0,0 +1,53 @@
+#!/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";
+}
+
View
53 integed-compare.pl
@@ -0,0 +1,53 @@
+#!/usr/bin/perl -w
+use strict;
+use DBI;
+use Scriptalicious;
+
+my $dbh = DBI->connect("dbi:Pg:", "", "", {PrintError => 1}) or die $DBI::errstr;
+
+do_integed_compare($dbh);
+
+sub do_integed_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-integed",
+ "p4", "integrated", $depotpath);
+ run(-out => "p4raw-integed",
+ "git-p4raw", "integrated", $depotpath);
+
+ if ( run_err("diff", "-q", "p4-integed", "p4raw-integed") ) {
+ print "...different\n";
+ if ( prompt_yN("see?") ) {
+ system("diff", "-u", "p4-integed", "p4raw-integed");
+ }
+ }
+ else {
+ $ok++;
+ }
+ unless ( ++$total % 100 ) {
+ print " $ok / $total good\e[K\n";
+ }
+ }
+ print "\n";
+ print "checked $total files, $ok good\n";
+}
+

0 comments on commit 6662987

Please sign in to comment.
Something went wrong with that request. Please try again.