diff options
author | Joey Hess <joey@kitenet.net> | 2010-06-23 19:32:53 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-06-23 19:32:53 -0400 |
commit | d8e4b51a41a9507584d56946d0eae0e5cef6d6f5 (patch) | |
tree | b0aeaa8fb5116d5869f8758792c17b94eb72fa83 | |
parent | ecdfd1b8644bc926db008054ab6192e18351afed (diff) |
rcs_getctime and rcs_getmtime take relative filenames
There was some confusion about whether the filename was
relative to srcdir or not. Some test cases, and the bzr
plugin assumed it was relative to the srcdir. Most everything else
assumed it was absolute.
Changed it to relative, for consistency with the rest
of the rcs_ functions.
-rw-r--r-- | IkiWiki/Plugin/cvs.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/darcs.pm | 9 | ||||
-rw-r--r-- | IkiWiki/Plugin/git.pm | 3 | ||||
-rw-r--r-- | IkiWiki/Plugin/mercurial.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/svn.pm | 6 | ||||
-rw-r--r-- | IkiWiki/Render.pm | 4 | ||||
-rw-r--r-- | debian/changelog | 2 |
7 files changed, 12 insertions, 16 deletions
diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index c6687d780..1a432c052 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -459,7 +459,7 @@ sub rcs_diff ($) { } sub rcs_getctime ($) { - my $file=shift; + my $file=$config{srcdir}."/".shift(); my $cvs_log_infoline=qr/^date: (.+);\s+author/; diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index 0dfc8708d..0f63b8807 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -396,14 +396,11 @@ sub rcs_getctime ($) { eval q{use XML::Simple}; local $/=undef; - my $filer=substr($file, length($config{srcdir})); - $filer =~ s:^[/]+::; - my $child = open(LOG, "-|"); if (! $child) { exec("darcs", "changes", "--xml", "--reverse", - "--repodir", $config{srcdir}, $filer) - || error("'darcs changes $filer' failed to run"); + "--repodir", $config{srcdir}, $file) + || error("'darcs changes $file' failed to run"); } my $data; @@ -418,7 +415,7 @@ sub rcs_getctime ($) { my $datestr = $log->{patch}[0]->{local_date}; if (! defined $datestr) { - warn "failed to get ctime for $filer"; + warn "failed to get ctime for $file"; return 0; } diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index b02fc118d..85368606e 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -658,9 +658,6 @@ sub findtimes ($$) { my $file=shift; my $id=shift; # 0 = mtime ; 1 = ctime - # Remove srcdir prefix - $file =~ s/^\Q$config{srcdir}\E\/?//; - if (! keys %time_cache) { my $date; foreach my $line (run_or_die('git', 'log', diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index edf915ae9..59dc63b4e 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -237,7 +237,7 @@ sub rcs_getctime ($) { my ($file) = @_; my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", - "--style", "default", $file); + "--style", "default", "$config{srcdir}/$file"); open (my $out, "-|", @cmdline); my @log = (mercurial_log($out)); diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index f1e608408..9cf82b5db 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -366,7 +366,7 @@ sub findtimes ($) { my $child = open(SVNLOG, "-|"); if (! $child) { - exec("svn", "log", $file) || error("svn log $file failed to run"); + exec("svn", "log", "$config{srcdir}/$file") || error("svn log failed to run"); } my ($cdate, $mdate); @@ -376,10 +376,10 @@ sub findtimes ($) { $mdate=$1 unless defined $mdate; } } - close SVNLOG || error "svn log $file exited $?"; + close SVNLOG || error "svn log exited $?"; if (! defined $cdate) { - error "failed to parse svn log for $file\n"; + error "failed to parse svn log for $file"; } eval q{use Date::Parse}; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index aae1f90b0..a653ab2da 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -374,7 +374,7 @@ sub find_new_files ($) { } eval { - my $ctime=rcs_getctime("$config{srcdir}/$file"); + my $ctime=rcs_getctime($file); if ($ctime > 0) { $pagectime{$page}=$ctime; } @@ -384,7 +384,7 @@ sub find_new_files ($) { } my $mtime; eval { - $mtime=rcs_getmtime("$config{srcdir}/$file"); + $mtime=rcs_getmtime($file); }; if ($@) { print STDERR $@; diff --git a/debian/changelog b/debian/changelog index f7452a070..88ed3a90b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * API: Add new optional field usershort to rcs_recentchanges. * API: rcs_commit and rcs_commit_staged are now passed named parameters. + * Fixed some confusion and bugginess about whether + rcs_getctime/rcs_getmtime were passed absolute or relative filenames. -- Joey Hess <joeyh@debian.org> Wed, 23 Jun 2010 15:30:04 -0400 |