X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/c566e16d9ee1d925626b24bb84f497ffba88986a..2f583a6e05c9f1d3c64dccc991d7578b4dd6345a:/IkiWiki/Rcs/svn.pm diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm index af4641d3a..761a40a27 100644 --- a/IkiWiki/Rcs/svn.pm +++ b/IkiWiki/Rcs/svn.pm @@ -5,8 +5,20 @@ use strict; use IkiWiki; use POSIX qw(setlocale LC_CTYPE); +package IkiWiki::Rcs::svn; + +sub import { #{{{ + if (exists $IkiWiki::config{svnpath}) { + # code depends on the path not having extraneous slashes + $IkiWiki::config{svnpath}=~tr#/#/#s; + $IkiWiki::config{svnpath}=~s/\/$//; + $IkiWiki::config{svnpath}=~s/^\///; + } +} #}}} + + package IkiWiki; - + # svn needs LC_CTYPE set to a UTF-8 locale, so try to find one. Any will do. sub find_lc_ctype() { my $current = setlocale(LC_CTYPE()); @@ -176,7 +188,8 @@ sub rcs_recentchanges ($) { #{{{ } foreach (keys %{$logentry->{paths}}) { - next unless /^\/\Q$config{svnpath}\E\/([^ ]+)(?:$|\s)/; + next unless ! length $config{svnpath} || + /^\/\Q$config{svnpath}\E\/([^ ]+)(?:$|\s)/; my $file=$1; my $diffurl=$config{diffurl}; $diffurl=~s/\[\[file\]\]/$file/g; @@ -218,7 +231,8 @@ sub rcs_notify () { #{{{ my @changed_pages; foreach my $change (`svnlook changed $config{svnrepo} -r $rev`) { chomp $change; - if ($change =~ /^[A-Z]+\s+\Q$config{svnpath}\E\/(.*)/) { + if (! length $config{svnpath} || + $change =~ /^[A-Z]+\s+\Q$config{svnpath}\E\/(.*)/) { push @changed_pages, $1; } }