return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $rev=shift;
+ my $maxlines=shift;
my @lines;
- foreach my $line (silentsystem("darcs", "diff", "--match", "hash ".$rev)) {
+ my $repodir=$config{srcdir};
+ foreach my $line (`darcs diff --repodir $repodir --match 'hash $rev'`) {
if (@lines || $line=~/^diff/) {
+ last if defined $maxlines && @lines == $maxlines;
push @lines, $line."\n";
}
}
eval q{use XML::Simple};
local $/=undef;
- my $filer=substr($file, length($config{srcdir}));
- $filer =~ s:^[/]+::;
-
my $child = open(LOG, "-|");
if (! $child) {
exec("darcs", "changes", "--xml", "--reverse",
- "--repodir", $config{srcdir}, $filer)
- || error("'darcs changes $filer' failed to run");
+ "--repodir", $config{srcdir}, $file)
+ || error("'darcs changes $file' failed to run");
}
my $data;
my $datestr = $log->{patch}[0]->{local_date};
if (! defined $datestr) {
- warn "failed to get ctime for $filer";
+ warn "failed to get ctime for $file";
return 0;
}