From 97e6f39dd0643ec9ce2f9d3488941d9e768c4392 Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 5 Jul 2006 17:40:07 +0000 Subject: * Patch from Faidon to use svn --limit when possible for recentchanges, speeds up recentchanges a lot for wikis with more history. --- IkiWiki/Rcs/svn.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Rcs') diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm index be4106a02..71517f215 100644 --- a/IkiWiki/Rcs/svn.pm +++ b/IkiWiki/Rcs/svn.pm @@ -105,9 +105,15 @@ sub rcs_recentchanges ($) { #{{{ eval q{use Date::Parse}; eval q{use Time::Duration}; eval q{use XML::Simple}; - + + # --limit is only supported on Subversion 1.2.0+ + my $svn_version=`svn --version -q`; + my $svn_limit=''; + $svn_limit="--limit $num" + if $svn_version =~ /\d\.(\d)\.\d/ && $1 >= 2; + my $svn_url=svn_info("URL", $config{srcdir}); - my $xml = XMLin(scalar `svn --xml -v log '$svn_url'`, + my $xml = XMLin(scalar `svn $svn_limit --xml -v log '$svn_url'`, ForceArray => [ 'logentry', 'path' ], GroupTags => { paths => 'path' }, KeyAttr => { path => 'content' }, -- cgit v1.2.3