]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/darcs.pm
s/castellano/espaƱol/
[git.ikiwiki.info.git] / IkiWiki / Plugin / darcs.pm
index 5927f23da7f220f790b32b35f6053bcaa81c8dd7..9b62e70e49e062fbcccfb5312e54157fcc5a1385 100644 (file)
@@ -298,8 +298,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,7 +313,6 @@ 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};
@@ -339,31 +336,30 @@ 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}});
 
                my $committype;
-               if ($patch->{author} =~ /\@web$/) {
+               my $author;
+               if ($patch->{author} =~ /(.*)\@web$/) {
+                       $author = $1;
                        $committype = "web";
                }
                else {
+                       $author=$patch->{author};
                        $committype = "darcs";
                }
 
                push @ret, {
                        rev => $patch->{hash},
-                       user => $patch->{author},
+                       user => $author,
                        committype => $committype,
                        when => $when, 
                        message => [@message],
@@ -397,16 +393,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");
        }