comparison piecrust/serving/procloop.py @ 1051:971b4d67e82a

serve: Fix problems with assets disappearing between servings. When an asset file changes, its source's pipeline is re-run. But that created a bake record that only had that pipeline's output, so the other outputs were incorrectly considered empty and therefore any stray files were removed. Now we copy over bake records for the pipelines we don't run.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 26 Jan 2018 18:05:02 -0800
parents 2f39ffa601a9
children 292e3a1316d8
comparison
equal deleted inserted replaced
1050:e0796761cdcc 1051:971b4d67e82a
150 allowed_sources = [only_for_source.name] 150 allowed_sources = [only_for_source.name]
151 baker = Baker( 151 baker = Baker(
152 self.appfactory, self._app, self.out_dir, 152 self.appfactory, self._app, self.out_dir,
153 allowed_pipelines=['asset'], 153 allowed_pipelines=['asset'],
154 allowed_sources=allowed_sources, 154 allowed_sources=allowed_sources,
155 rotate_bake_records=False) 155 rotate_bake_records=False,
156 keep_unused_records=(allowed_sources is not None))
156 records = baker.bake() 157 records = baker.bake()
157 158
158 self._onPipelinesRun(records) 159 self._onPipelinesRun(records)
159 160
160 def _onPipelinesRun(self, records): 161 def _onPipelinesRun(self, records):