aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-11-16 17:26:20 -0400
committerJoey Hess <joey@kitenet.net>2013-11-16 17:26:20 -0400
commit654530fa8bb0937123ed526e3093170ef23f5295 (patch)
treeaabce3b4b6148b0d7e3b443a25f36c15e10353a8 /IkiWiki.pm
parent3aaa33064c4593941559f132632b9d19d9146271 (diff)
downloadikiwiki-654530fa8bb0937123ed526e3093170ef23f5295.tar
ikiwiki-654530fa8bb0937123ed526e3093170ef23f5295.tar.gz
Added only_committed_changes config setting, which speeds up wiki refresh by querying git to find the files that were changed, rather than looking at the work tree. Not enabled by default as it can break some setups where not all files get committed to git.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index af8e07d7f..b7080bb0b 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -14,7 +14,7 @@ use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
%pagestate %wikistate %renderedfiles %oldrenderedfiles
%pagesources %delpagesources %destsources %depends %depends_simple
@mass_depends %hooks %forcerebuild %loaded_plugins %typedlinks
- %oldtypedlinks %autofiles};
+ %oldtypedlinks %autofiles @underlayfiles $lastrev};
use Exporter q{import};
our @EXPORT = qw(hook debug error htmlpage template template_depends
@@ -134,6 +134,13 @@ sub getsetup () {
safe => 1,
rebuild => 0,
},
+ only_committed_changes => {
+ type => "boolean",
+ default => 0,
+ description => "enable optimization of only refreshing committed changes?",
+ safe => 1,
+ rebuild => 0,
+ },
rcs => {
type => "string",
default => '',
@@ -1881,6 +1888,8 @@ sub loadindex () {
foreach my $page (keys %renderedfiles) {
$destsources{$_}=$page foreach @{$renderedfiles{$page}};
}
+ $lastrev=$index->{lastrev};
+ @underlayfiles=@{$index->{underlayfiles}} if ref $index->{underlayfiles};
return close($in);
}
@@ -1934,6 +1943,9 @@ sub saveindex () {
}
}
+ $index{lastrev}=$lastrev;
+ $index{underlayfiles}=\@underlayfiles;
+
$index{version}="3";
my $ret=Storable::nstore_fd(\%index, $out);
return if ! defined $ret || ! $ret;