#!/usr/bin/perl -w $fname = ""; #file name $rev_no = ""; # revision number @rev_struct = (); # revision structure $" = ":"; # delimiter for array elements #Open an input handle to read all the TWiki attachments $attachments = "attachments.txt"; open(DOCS,"$attachments") or die "Cannot find $attachments $!"; #Open an output handle to record each attachment's revision data $attachrevs = "revdata.txt"; open(REVREC,">>$attachrevs") or die "Cannot create revision record $!"; while() { open(REVINFO,"rlog $_|") or die "Cannot open the rlog data $!"; # Parse the rlog file and populate the revisions structure while() { if ($_ =~ m/^Working\sfile:\s(.+)/g) { $fname = $1; push(@rev_struct,$fname);} if ($_ =~ m/^revision\s(.+)/g) { $rev_no = $1; push(@rev_struct,"$rev_no");} } # Print the revisions data print REVREC "@rev_struct\n"; @rev_struct = (); # empty the revisions structure }