X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/760e1009470d624b272020d5e4abc17483b23a33..4711076fad54ff8152f03a7e4bdd4b5c2df1916c:/IkiWiki/Plugin/darcs.pm diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index 1ed9f0044..1c9538e83 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -73,7 +73,7 @@ sub darcs_rev($) { my $file = shift; # Relative to the repodir. my $repodir = $config{srcdir}; - return "" if (! file_in_vc($repodir, $file)); + return "" unless file_in_vc($repodir, $file); my $hash = darcs_info('hash', $repodir, $file); return defined $hash ? $hash : ""; } @@ -92,6 +92,7 @@ sub getsetup() { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, darcs_wrapper => { type => "string", @@ -298,8 +299,6 @@ sub rcs_recentchanges ($) { my $repodir=$config{srcdir}; - debug("darcs recent changes: $num"); - my $child = open(LOG, "-|"); if (! $child) { $ENV{"DARCS_DONT_ESCAPE_ANYTHING"}=1; @@ -315,15 +314,14 @@ sub rcs_recentchanges ($) { my $log = XMLin($data, ForceArray => 1); - debug("parsing recent changes..."); foreach my $patch (@{$log->{patch}}) { my $date=$patch->{local_date}; my $hash=$patch->{hash}; my $when=str2time($date); my (@pages, @files, @pg); - push @pages, $_ for (@{$patch->{summary}->[0]->{modify_file}}); - push @pages, $_ for (@{$patch->{summary}->[0]->{add_file}}); - push @pages, $_ for (@{$patch->{summary}->[0]->{remove_file}}); + push @pages, $_ foreach (@{$patch->{summary}->[0]->{modify_file}}); + push @pages, $_ foreach (@{$patch->{summary}->[0]->{add_file}}); + push @pages, $_ foreach (@{$patch->{summary}->[0]->{remove_file}}); foreach my $f (@pages) { $f = $f->{content} if ref $f; $f =~ s,^\s+,,; $f =~ s,\s+$,,; # cut whitespace @@ -339,16 +337,12 @@ sub rcs_recentchanges ($) { $d =~ s/\[\[file\]\]/$f/go; $d =~ s/\[\[hash\]\]/$hash/go; - debug("file: $f"); - debug("diffurl: $d"); push @pg, { page => pagename($f), diffurl => $d, }; } next unless (scalar @pg > 0); - debug("recent change: " . $patch->{name}[0] . " (" - . scalar @pg . " changes)"); my @message; push @message, { line => $_ } foreach (@{$patch->{name}}); @@ -400,16 +394,13 @@ sub rcs_getctime ($) { eval q{use XML::Simple}; local $/=undef; - # Sigh... doing things the hard way again - my $repodir=$config{srcdir}; - - my $filer=substr($file, length($repodir)); + my $filer=substr($file, length($config{srcdir})); $filer =~ s:^[/]+::; my $child = open(LOG, "-|"); if (! $child) { exec("darcs", "changes", "--xml", "--reverse", - "--repodir", "$repodir", "$filer") + "--repodir", $config{srcdir}, $filer) || error("'darcs changes $filer' failed to run"); }