diff piecrust/baking/records.py @ 96:0445a2232de7

Improvements and fixes to incremental baking. * Better handling of the render pass during page rendering. * Used sources are paired with the pass they were used in. * Proper use and invalidation of the rendered segments cache based on render passes. * The `Assetor` is also better tracking what was used in a page. * Add flags on a page to get better caching information for the debug window. * Property invalidation of the previous bake record when needed. * Better information about why pages are delayed.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 07 Sep 2014 23:48:57 -0700
parents e88e330eb8dc
children 133845647083
line wrap: on
line diff
--- a/piecrust/baking/records.py	Sun Sep 07 21:37:10 2014 -0700
+++ b/piecrust/baking/records.py	Sun Sep 07 23:48:57 2014 -0700
@@ -8,7 +8,7 @@
 logger = logging.getLogger(__name__)
 
 
-RECORD_VERSION = 4
+RECORD_VERSION = 6
 
 
 def _get_transition_key(source_name, rel_path, taxonomy_name=None,
@@ -75,10 +75,6 @@
         return _get_transition_key(self.source_name, self.rel_path,
                 self.taxonomy_name, self.taxonomy_term)
 
-    def addUsedSource(self, source):
-        if isinstance(source, PageSource):
-            self.used_source_names.add(source.name)
-
     def __getstate__(self):
         state = self.__dict__.copy()
         del state['path_mtime']
@@ -110,6 +106,9 @@
         for e in self.previous.entries:
             self.transitions[e.transition_key] = (e, None)
 
+    def clearPrevious(self):
+        self.previous = BakeRecord()
+
     def saveCurrent(self, current_path):
         self.current.save(current_path)