]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/darcs.pm
fix display of web commits in recentchanges
[ikiwiki.git] / IkiWiki / Plugin / darcs.pm
index 978457b2c5163c450add7fe3d0c7d2be91679982..1ed9f0044aa25d3f6e8b5f914f3844b80307cf7b 100644 (file)
@@ -1,42 +1,4 @@
 #!/usr/bin/perl
-# Support for the darcs rcs, <URL:http://darcs.net/>.
-# Copyright (C) 2006  Thomas Schwinge <tschwinge@gnu.org>
-#               2007  Benjamin A'Lee <bma@bmalee.eu>
-#                     Tuomo Valkonen <tuomov@iki.fi>
-#               2008  Simon Michael <simon@joyful.com>
-#                     Petr Ročkai <me@mornfall.net>
-#                     Sven M. Hallberg <pesco@khjk.org>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# History (see http://ikiwiki.info/todo/darcs/):
-#
-#  * Thomas Schwinge wrote the original file, implementing only rcs_commit.
-#  * Benjamin A'Lee contributed an alternative implementation.
-#  * Tuomo Valkonen contributed rcs_getctime and stub rcs_recentchanges.
-#  * Simon Michael contributed multiple changes.
-#  * Petr Ročkai fixed rcs_recentchanges and added caching to rcs_getctime.
-#  * Sven M. Hallberg merged the above and added missing features.
-
-
-# We're guaranteed to be the only instance of ikiwiki running at a given
-# time.  It is essential that only ikiwiki is working on a particular
-# repository.  That means one instance of ikiwiki and it also means that
-# you must not 'darcs push' into this repository, as this might create
-# race conditions, as I understand it.
-
 package IkiWiki::Plugin::darcs;
 
 use warnings;
@@ -243,7 +205,7 @@ sub rcs_commit ($$$;$$) {
        # Update the repository by pulling from the default repository, which is
        # master repository.
        silentsystem('darcs', "pull", "--quiet", "--repodir", $config{srcdir},
-               "--all") !=0 || error("'darcs pull' failed");
+               "--all") == 0 || error("'darcs pull' failed");
 
        # If this updating yields any conflicts, we'll record them now to resolve
        # them.  If nothing is recorded, there are no conflicts.
@@ -392,16 +354,19 @@ sub rcs_recentchanges ($) {
                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],