From dc4bc05fab0cb738b0051d8e3e037ae73cb9f0a6 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 19 Sep 2013 13:33:14 +0000 Subject: b&m: Use new MorphSet api in unpetrify --- morphlib/plugins/branch_and_merge_new_plugin.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py index 4329e0c2..39552ef0 100644 --- a/morphlib/plugins/branch_and_merge_new_plugin.py +++ b/morphlib/plugins/branch_and_merge_new_plugin.py @@ -708,33 +708,11 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): ws = morphlib.workspace.open('.') sb = morphlib.sysbranchdir.open_from_within('.') loader = morphlib.morphloader.MorphologyLoader() - lrc, rrc = morphlib.util.new_repo_caches(self.app) - update_repos = not self.app.settings['no-git-update'] - done = set() morphs = self._load_all_sysbranch_morphologies(sb, loader) # Restore the ref for each stratum and chunk - def unpetrify_specs(specs): - dirty = False - for spec in specs: - ref = spec['ref'] - # Don't attempt to unpetrify refs which aren't petrified - if not ('unpetrify-ref' in spec - and morphlib.git.is_valid_sha1(ref)): - continue - spec['ref'] = spec.pop('unpetrify-ref') - dirty = True - return dirty - - for m in morphs.morphologies: - dirty = False - if m['kind'] == 'system': - dirty = dirty or unpetrify_specs(m['strata']) - elif m['kind'] == 'stratum': - dirty = dirty or unpetrify_specs(m['build-depends']) - dirty = dirty or unpetrify_specs(m['chunks']) - m.dirty = True + morphs.unpetrify_all() # Write morphologies back out again. self._save_dirty_morphologies(loader, sb, morphs.morphologies) -- cgit v1.2.1