diff piecrust/pipelines/records.py @ 989:8adc27285d93

bake: Big pass on bake performance. - Reduce the amount of data passed between processes. - Make inter-process data simple objects to make it easier to test with alternatives to pickle. - Make sources have the basic requirement to be able to find a content item from an item spec (path). - Make Hoedown the default Markdown formatter.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 19 Nov 2017 14:29:17 -0800
parents 45ad976712ec
children
line wrap: on
line diff
--- a/piecrust/pipelines/records.py	Fri Nov 03 23:14:56 2017 -0700
+++ b/piecrust/pipelines/records.py	Sun Nov 19 14:29:17 2017 -0800
@@ -37,6 +37,7 @@
     def __init__(self, name):
         self.name = name
         self.deleted_out_paths = []
+        self.user_data = {}
         self.success = True
         self._entries = {}
 
@@ -61,7 +62,7 @@
     """ A container that includes multiple `Record` instances -- one for
         each content source that was baked.
     """
-    RECORD_VERSION = 12
+    RECORD_VERSION = 13
 
     def __init__(self):
         self.records = []
@@ -208,6 +209,9 @@
                         "A current record entry already exists for '%s' "
                         "(%s)" % (key, diff[1].item_spec))
 
+    def copy(self):
+        return RecordHistory(self._previous, self._current)
+
 
 class MultiRecordHistory:
     """ Tracks the differences between an 'old' and a 'new' record