diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2013-07-02 15:08:39 +0100 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2013-07-02 15:08:39 +0100 |
commit | cc04afc00f35dc00e03c9ab207bbc2e5513812d0 (patch) | |
tree | 2d942177596fc6f9ca9c0614f901dd272c283905 | |
parent | 656295846bffb4eda9fa3869d04fd7c042b2e37a (diff) | |
parent | 835056e716ed6df6e81cd1bc12eb8a585998f71d (diff) | |
download | morph-cc04afc00f35dc00e03c9ab207bbc2e5513812d0.tar.gz |
Merge branch 'jonathan/fix-petrify'
Reviewed-by: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index f7109bcf..2d6b715c 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -925,60 +925,13 @@ class BranchAndMergePlugin(cliapp.Plugin): if len(args) != 0: raise cliapp.AppException('morph petrify takes no arguments') - workspace = self.deduce_workspace() branch, branch_path = self.deduce_system_branch() root_repo = self.get_branch_config(branch_path, 'branch.root') root_repo_dir = self.find_repository(branch_path, root_repo) self.lrc, self.rrc = morphlib.util.new_repo_caches(self.app) - # We must first get the full set of strata. One same stratum may be - # in multiple systems and each system may use a different ref. - strata = {} - for f in sorted(glob.iglob(os.path.join(root_repo_dir, '*.morph'))): - name = os.path.basename(f)[:-len('.morph')] - morphology = self.load_morphology(root_repo_dir, name) - if morphology['kind'] != 'system': - continue - - for stratum_info in morphology['strata']: - key = (stratum_info['repo'], stratum_info['morph']) - if key in strata: - original_ref = strata[key] - if stratum_info['ref'] == branch: - strata[key] = branch - elif stratum_info['ref'] != original_ref: - if original_ref != branch: - self.app.output.write( - 'WARNING: not merging any differences from ' - 'ref %s into %s of stratum %s\n' % - (stratum_info['ref'], original_ref, - stratum_info['morph'])) - stratum_info['ref'] = branch - else: - strata[key] = stratum_info['ref'] - stratum_info['ref'] = branch - self.update_morphology(root_repo_dir, name, morphology) - - for (repo, morph), ref in strata.iteritems(): - repo_dir = self.make_available( - { 'repo': repo, 'ref': ref, 'morph': morph}, - branch, branch_path, root_repo, root_repo_dir) - - stratum = self.load_morphology(repo_dir, morph) - - for chunk_info in stratum['chunks']: - if (chunk_info['ref'] != branch and - 'unpetrify-ref' not in chunk_info): - commit_sha1, tree_sha1 = self.app.resolve_ref( - self.lrc, self.rrc, chunk_info['repo'], - chunk_info['ref'], - update=not self.app.settings['no-git-update']) - chunk_info['unpetrify-ref'] = chunk_info['ref'] - chunk_info['ref'] = commit_sha1 - self.update_morphology(repo_dir, morph, stratum) - - self.print_changelog('The following changes were made but have not ' - 'been committed') + self.petrify_everything(branch, branch_path, root_repo, root_repo_dir, + branch) def unpetrify(self, args): '''Reverse the process of petrification''' |