diff options
-rw-r--r-- | morphlib/buildbranch.py | 6 | ||||
-rw-r--r-- | morphlib/plugins/branch_and_merge_new_plugin.py | 4 | ||||
-rw-r--r-- | morphlib/sysbranchdir.py | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/morphlib/buildbranch.py b/morphlib/buildbranch.py index d415e7e1..1b028cc3 100644 --- a/morphlib/buildbranch.py +++ b/morphlib/buildbranch.py @@ -140,7 +140,11 @@ class BuildBranch(object): morphs.traverse_specs(process, filter) - if any(m.dirty for m in morphs.morphologies): + dirtied = [m for m in morphs.morphologies if m.dirty] + + if dirtied: + for morph in dirtied: + loader.validate(morph) yield self._root self._root_index.add_files_from_index_info( diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py index 5ac8353a..4dd7cf6a 100644 --- a/morphlib/plugins/branch_and_merge_new_plugin.py +++ b/morphlib/plugins/branch_and_merge_new_plugin.py @@ -266,6 +266,10 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): for morph in morphs: if morph.dirty: logging.debug( + 'Validating morphology: %s %s %s' % + (morph.repo_url, morph.ref, morph.filename)) + loader.validate(morph) + logging.debug( 'Saving morphology: %s %s %s' % (morph.repo_url, morph.ref, morph.filename)) loader.unset_defaults(morph) diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py index 9d96e974..23b54eb9 100644 --- a/morphlib/sysbranchdir.py +++ b/morphlib/sysbranchdir.py @@ -178,7 +178,9 @@ class SystemBranchDirectory(object): mf = morphlib.morphologyfinder.MorphologyFinder(gd) for morph in mf.list_morphologies(): text, filename = mf.read_morphology(morph) - m = loader.load_from_string(text, filename=filename) + m = loader.parse_morphology_text(text, filename) + loader.set_defaults(m) + m.filename = filename m.repo_url = self.root_repository_url m.ref = self.system_branch_name yield m |