#/usr/bin/perl
#
#
# Read in a list that looks like:
# 29300:\t1\tcalled @ 1:04 pm, need to talk to Leslie\tDean
# From this, create files in the subdirectory "data" that look like
# this:
# (named data/29300.txt)
# ---->revision #1
# contents of revision one of that call in calltrack
# ---->revision #2
# contents of revision two of that call in calltrack
# ...
$p4c = "p4c";
while (<>) {
chomp;
($callno, $revrange, $subject, $person) =
split(/\t/);
next if (-f "data/$callno.html");
open(CALLFILE, ">data/$callno.txt") ||
die "Cannot open data/$callno.txt\n";
foreach $r (1 .. $revrange) {
my(@tmp) = `$p4c print -q //depot/calls/$callno#$r`;
print CALLFILE "<h2>$callno revision $r</h2>\n";
print CALLFILE "<p>\n";
print CALLFILE @tmp;
}
close(CALLFILE);
}