-#!/usr/pkg/bin/perl
+#!/usr/bin/perl
package IkiWiki::Plugin::cvs;
-# Copyright (c) 2008 Amitai Schlair
+# Copyright (c) 2009 Amitai Schlair
# All rights reserved.
#
# This code is derived from software contributed to ikiwiki
hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges);
hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff);
hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
+ hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime);
}
sub genwrapper () {
plugin => {
safe => 0, # rcs plugin
rebuild => undef,
+ section => "rcs",
},
cvsrepo => {
type => "string",
return defined $rev ? $rev : "";
}
-sub rcs_commit ($$$;$$) {
+sub rcs_commit ($$$;$$$) {
# Tries to commit the page; returns undef on _success_ and
# a version of the page with the rcs's conflict markers on failure.
# The file is relative to the srcdir.
my $rcstoken=shift;
my $user=shift;
my $ipaddr=shift;
+ my $emailuser=shift;
return unless cvs_is_controlling;
return undef # success
}
-sub rcs_commit_staged ($$$) {
+sub rcs_commit_staged ($$$;$) {
# Commits all staged changes. Changes can be staged using rcs_add,
# rcs_remove, and rcs_rename.
- my ($message, $user, $ipaddr)=@_;
+ my ($message, $user, $ipaddr, $emailuser)=@_;
if (defined $user) {
$message="web commit by $user".(length $message ? ": $message" : "");
rcs_remove($src);
}
-sub rcs_recentchanges($) {
+sub rcs_recentchanges ($) {
my $num = shift;
my @ret;
eval q{use File::ReadBackwards};
error($@) if $@;
- my (undef, $tmpfile) = tempfile(OPEN=>0);
+ my ($tmphandle, $tmpfile) = tempfile();
system("env TZ=UTC cvsps -q --cvs-direct -z 30 -x >$tmpfile");
if ($? == -1) {
error "couldn't run cvsps: $!\n";
return $date;
}
+sub rcs_getmtime ($) {
+ error "rcs_getmtime is not implemented for cvs\n"; # TODO
+}
+
1