diff options
-rw-r--r-- | morphlib/plugins/branch_and_merge_new_plugin.py | 1 | ||||
-rwxr-xr-x | tests.branching/add-then-edit.script | 29 | ||||
-rw-r--r-- | tests.branching/edit-updates-stratum-build-depends.stdout | 25 | ||||
-rw-r--r-- | tests.branching/edit-updates-stratum.stdout | 19 | ||||
-rw-r--r-- | tests.branching/petrify.stdout | 8 |
5 files changed, 26 insertions, 56 deletions
diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py index 2099f20b..7c326e48 100644 --- a/morphlib/plugins/branch_and_merge_new_plugin.py +++ b/morphlib/plugins/branch_and_merge_new_plugin.py @@ -235,6 +235,7 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): logging.debug( 'Saving morphology: %s %s %s' % (morph.repo_url, morph.ref, morph.filename)) + loader.unset_defaults(morph) loader.save_to_file( sb.get_filename(morph.repo_url, morph.filename), morph) morph.dirty = False diff --git a/tests.branching/add-then-edit.script b/tests.branching/add-then-edit.script index d6a2270f..5cd6e842 100755 --- a/tests.branching/add-then-edit.script +++ b/tests.branching/add-then-edit.script @@ -32,23 +32,18 @@ cd test:morphs ## Sub-optimally, to alter the stratum, you have to `morph edit` it first "$SRCDIR/scripts/test-morph" edit hello-system hello-stratum -git apply <<'EOF' -diff --git a/hello-stratum.morph b/hello-stratum.morph -index 3b7be17..c79a9af 100644 ---- a/hello-stratum.morph -+++ b/hello-stratum.morph -@@ -5,6 +5,10 @@ - name: hello - ref: master - repo: test:hello -+- build-depends: [] -+ name: goodbye -+ ref: master -+ repo: test:goodbye - description: '' - kind: stratum - name: hello-stratum -EOF +python -c 'import yaml +with open("hello-stratum.morph", "r") as f: + stratum = yaml.load(f) +stratum["chunks"].append({ + "build-depends": [], + "name": "goodbye", + "ref": "master", + "repo": "test:goodbye", +}) +with open("hello-stratum.morph", "w") as f: + yaml.dump(stratum, f) +' "$SRCDIR/scripts/test-morph" edit hello-system hello-stratum goodbye diff --git a/tests.branching/edit-updates-stratum-build-depends.stdout b/tests.branching/edit-updates-stratum-build-depends.stdout index 5b556e3c..00b303bd 100644 --- a/tests.branching/edit-updates-stratum-build-depends.stdout +++ b/tests.branching/edit-updates-stratum-build-depends.stdout @@ -1,30 +1,21 @@ diff --git a/hello-stratum.morph b/hello-stratum.morph -index 73ed482..b3f27b4 100644 +index 73ed482..3731d63 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -1,8 +1,11 @@ -+build-depends: [] - chunks: +@@ -2,7 +2,7 @@ chunks: - build-depends: [] build-mode: test -+ morph: hello name: hello - ref: master + ref: newbranch repo: test:hello -+description: '' kind: stratum name: hello-stratum diff --git a/hello-system.morph b/hello-system.morph -index 721473c..a4c5640 100644 +index 721473c..94c1837 100644 --- a/hello-system.morph +++ b/hello-system.morph -@@ -1,9 +1,12 @@ - arch: x86_64 -+configuration-extensions: [] -+description: '' -+disk-size: 1G - kind: system +@@ -3,9 +3,8 @@ kind: system name: hello-system strata: - morph: hello-stratum @@ -33,11 +24,13 @@ index 721473c..a4c5640 100644 repo: test:morphs - morph: xyzzy-stratum ref: master + repo: test:morphs +-system-kind: rootfs-tarball diff --git a/xyzzy-stratum.morph b/xyzzy-stratum.morph -index e302037..71e7651 100644 +index e302037..97f7208 100644 --- a/xyzzy-stratum.morph +++ b/xyzzy-stratum.morph -@@ -1,11 +1,13 @@ +@@ -1,11 +1,11 @@ build-depends: - morph: hello-stratum - ref: master @@ -45,11 +38,9 @@ index e302037..71e7651 100644 repo: test:morphs chunks: - build-depends: [] -+ morph: hello name: hello - ref: master + ref: newbranch repo: test:hello -+description: '' kind: stratum name: xyzzy-stratum diff --git a/tests.branching/edit-updates-stratum.stdout b/tests.branching/edit-updates-stratum.stdout index f6a1587c..e84dbe09 100644 --- a/tests.branching/edit-updates-stratum.stdout +++ b/tests.branching/edit-updates-stratum.stdout @@ -1,34 +1,25 @@ diff --git a/hello-stratum.morph b/hello-stratum.morph -index 73ed482..b3f27b4 100644 +index 73ed482..3731d63 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -1,8 +1,11 @@ -+build-depends: [] - chunks: +@@ -2,7 +2,7 @@ chunks: - build-depends: [] build-mode: test -+ morph: hello name: hello - ref: master + ref: newbranch repo: test:hello -+description: '' kind: stratum name: hello-stratum diff --git a/hello-system.morph b/hello-system.morph -index b0fed3b..b1417ce 100644 +index b0fed3b..801a955 100644 --- a/hello-system.morph +++ b/hello-system.morph -@@ -1,8 +1,11 @@ - arch: x86_64 -+configuration-extensions: [] -+description: '' -+disk-size: 1G - kind: system +@@ -3,6 +3,5 @@ kind: system name: hello-system strata: - morph: hello-stratum - ref: master + ref: newbranch repo: test:morphs - system-kind: rootfs-tarball +-system-kind: rootfs-tarball diff --git a/tests.branching/petrify.stdout b/tests.branching/petrify.stdout index e41c2f02..213c6879 100644 --- a/tests.branching/petrify.stdout +++ b/tests.branching/petrify.stdout @@ -1,39 +1,31 @@ Petrified: -build-depends: [] chunks: - build-depends: [] build-mode: test - morph: hello name: hello ref: 6c7ddb7a9c0c5bf4ee02a8de030f0892a399c6bb repo: test:hello unpetrify-ref: master - build-depends: [] build-mode: test - morph: goodbye name: goodbye ref: d34c96a9f07c2efd1faabc3b44f77c25580a276e repo: test:goodbye unpetrify-ref: test/petrify -description: '' kind: stratum name: hello-stratum Unpetrified: -build-depends: [] chunks: - build-depends: [] build-mode: test - morph: hello name: hello ref: master repo: test:hello - build-depends: [] build-mode: test - morph: goodbye name: goodbye ref: test/petrify repo: test:goodbye -description: '' kind: stratum name: hello-stratum |