summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py7
-rw-r--r--tests.branching/petrify.stdout4
2 files changed, 6 insertions, 5 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index 910022e0..e5c5fb44 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -155,11 +155,11 @@ class BranchAndMergePlugin(cliapp.Plugin):
'''Make refs to chunks be absolute SHA-1s.'''
app = self.app
- cache = morphlib.util.new_repo_caches(self.app)[0]
+ cache = morphlib.util.new_repo_caches(app)[0]
for filename in args:
with open(filename) as f:
- morph = json.load(f)
+ morph = morphlib.morph2.Morphology(f.read())
if morph['kind'] != 'stratum':
app.status(msg='Not a stratum: %(filename)s',
@@ -178,8 +178,7 @@ class BranchAndMergePlugin(cliapp.Plugin):
repo = cache.get_repo(reponame)
source['ref'] = repo.resolve_ref(ref)
- with open(filename, 'w') as f:
- json.dump(morph, f, indent=4, sort_keys=True)
+ self.write_morphology(filename, morph)
def init(self, args):
'''Initialize a mine.'''
diff --git a/tests.branching/petrify.stdout b/tests.branching/petrify.stdout
index bf8eb1a1..1ef133aa 100644
--- a/tests.branching/petrify.stdout
+++ b/tests.branching/petrify.stdout
@@ -1,12 +1,14 @@
{
+ "build-system": "manual",
"kind": "stratum",
"name": "hello-stratum",
"sources": [
{
"build-depends": [],
+ "morph": "hello",
"name": "hello",
"ref": "f4d032b42c0134e67bdf19a43fa99072493667d7",
"repo": "baserock:hello"
}
]
-} \ No newline at end of file
+}