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 silentsystem (@) {
return $_;
}
-sub file_in_vc($$) {
+sub file_in_vc ($$) {
my $repodir = shift;
my $file = shift;
}
my $found=0;
while (<DARCS_MANIFEST>) {
- $found = 1, last if /^(\.\/)?$file$/;
+ $found = 1 if /^(\.\/)?$file$/;
}
close(DARCS_MANIFEST) or error("'darcs query manifest' exited " . $?);
return $found;
}
-sub darcs_rev($) {
+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 : "";
}
-sub checkconfig() {
+sub checkconfig () {
if (defined $config{darcs_wrapper} && length $config{darcs_wrapper}) {
push @{$config{wrappers}}, {
wrapper => $config{darcs_wrapper},
}
}
-sub getsetup() {
+sub getsetup () {
return
plugin => {
safe => 0, # rcs plugin
rebuild => undef,
+ section => "rcs",
},
darcs_wrapper => {
type => "string",
return $rev;
}
-sub rcs_commit ($$$;$$) {
+sub rcs_commit ($$$;$$$) {
# Commit the page. Returns 'undef' on success and a version of the page
# with conflict markers on failure.
- my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
+ my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_;
# Compute if the "revision" of $file changed.
my $changed = darcs_rev($file) ne $rcstoken;
}
}
-sub rcs_commit_staged($$$) {
- my ($message, $user, $ipaddr) = @_;
+sub rcs_commit_staged ($$$;$) {
+ my ($message, $user, $ipaddr, $emailuser) = @_;
my $author;
if (defined $user) {
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
return $date;
}
+sub rcs_getmtime ($) {
+ error "rcs_getmtime is not implemented for darcs\n"; # TODO
+}
+
1