Mercurial > piecrust2
changeset 753:9a92e2804562
bake: Add the list of deleted files to the bake/processing records.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 25 Jun 2016 16:58:59 -0700 |
parents | 7dbddfed8129 |
children | 78de21447e4e |
files | piecrust/baking/baker.py piecrust/baking/records.py piecrust/processing/pipeline.py piecrust/processing/records.py |
diffstat | 4 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/baking/baker.py Thu Jun 09 23:32:15 2016 -0700 +++ b/piecrust/baking/baker.py Sat Jun 25 16:58:59 2016 -0700 @@ -379,6 +379,7 @@ logger.debug("Handling deletions...") for path, reason in record.getDeletions(): logger.debug("Removing '%s': %s" % (path, reason)) + record.current.deleted.append(path) try: os.remove(path) logger.info('[delete] %s' % path)
--- a/piecrust/baking/records.py Thu Jun 09 23:32:15 2016 -0700 +++ b/piecrust/baking/records.py Sat Jun 25 16:58:59 2016 -0700 @@ -16,7 +16,7 @@ class BakeRecord(Record): - RECORD_VERSION = 19 + RECORD_VERSION = 20 def __init__(self): super(BakeRecord, self).__init__() @@ -24,6 +24,7 @@ self.bake_time = None self.baked_count = {} self.total_baked_count = {} + self.deleted = [] self.success = True @@ -107,6 +108,11 @@ yield from sub.assets @property + def all_out_paths(self): + for sub in self.subs: + yield sub.out_path + + @property def has_any_error(self): if len(self.errors) > 0: return True
--- a/piecrust/processing/pipeline.py Thu Jun 09 23:32:15 2016 -0700 +++ b/piecrust/processing/pipeline.py Sat Jun 25 16:58:59 2016 -0700 @@ -166,6 +166,7 @@ if delete: for path, reason in record.getDeletions(): logger.debug("Removing '%s': %s" % (path, reason)) + record.current.deleted.append(path) try: os.remove(path) except FileNotFoundError:
--- a/piecrust/processing/records.py Thu Jun 09 23:32:15 2016 -0700 +++ b/piecrust/processing/records.py Sat Jun 25 16:58:59 2016 -0700 @@ -4,13 +4,14 @@ class ProcessorPipelineRecord(Record): - RECORD_VERSION = 6 + RECORD_VERSION = 7 def __init__(self): super(ProcessorPipelineRecord, self).__init__() self.out_dir = None self.process_time = None self.processed_count = 0 + self.deleted = [] self.success = False @@ -79,7 +80,9 @@ if prev and cur and not cur.was_processed: # This asset wasn't processed, so the information from # last time is still valid. - cur.flags = prev.flags | FLAG_COLLAPSED_FROM_LAST_RUN + cur.flags = (prev.flags + & ~FLAG_PROCESSED + | FLAG_COLLAPSED_FROM_LAST_RUN) cur.rel_outputs = list(prev.rel_outputs) cur.errors = list(prev.errors)