diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-30 12:24:29 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-30 12:24:29 +0000 |
commit | be67d3d4c416394588678f67cbc69c879bfc4137 (patch) | |
tree | 0a5e5dbdf268e05b24b341d315f4c3dda5f82dfa /tests.branching | |
parent | 117a71825439b03d816536099ad92de47655e622 (diff) | |
parent | 2beadc4d94bd77e1794832c758b6174ff1ada0a6 (diff) | |
download | morph-be67d3d4c416394588678f67cbc69c879bfc4137.tar.gz |
Merge branch 'baserock/richardmaw/S8694/edit-no-write-defaults-v3'
Reviewed-by: Lars Wirzenius
Reviewed-by: Jonathan Maw
Diffstat (limited to 'tests.branching')
-rwxr-xr-x | tests.branching/add-then-edit.script | 37 | ||||
-rwxr-xr-x | tests.branching/edit-checkouts-existing-chunk.script | 2 | ||||
-rwxr-xr-x | tests.branching/edit-clones-chunk.script | 2 | ||||
-rwxr-xr-x | tests.branching/edit-handles-submodules.script | 2 | ||||
-rwxr-xr-x | tests.branching/edit-updates-stratum-build-depends.script | 2 | ||||
-rw-r--r-- | tests.branching/edit-updates-stratum-build-depends.stdout | 25 | ||||
-rwxr-xr-x | tests.branching/edit-updates-stratum.script | 2 | ||||
-rw-r--r-- | tests.branching/edit-updates-stratum.stdout | 19 | ||||
-rwxr-xr-x | tests.branching/edit-works-after-branch-root-was-renamed.script | 2 | ||||
-rwxr-xr-x | tests.branching/petrify.script | 2 | ||||
-rw-r--r-- | tests.branching/petrify.stdout | 8 |
11 files changed, 36 insertions, 67 deletions
diff --git a/tests.branching/add-then-edit.script b/tests.branching/add-then-edit.script index cdb28fd2..5cd6e842 100755 --- a/tests.branching/add-then-edit.script +++ b/tests.branching/add-then-edit.script @@ -30,27 +30,22 @@ cd "me/add-then-edit" cd test:morphs ## Sub-optimally, to alter the stratum, you have to `morph edit` it first -"$SRCDIR/scripts/test-morph" new-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 - -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum goodbye +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum + +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 # check whether the stratum still contains the goodbye chunk grep -qFe goodbye hello-stratum.morph diff --git a/tests.branching/edit-checkouts-existing-chunk.script b/tests.branching/edit-checkouts-existing-chunk.script index 9584d1a3..9e66ceb0 100755 --- a/tests.branching/edit-checkouts-existing-chunk.script +++ b/tests.branching/edit-checkouts-existing-chunk.script @@ -27,7 +27,7 @@ cd "$DATADIR/workspace" # Edit the hello chunk in alfred. cd "alfred" -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum hello +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello echo "Current branches:" "$SRCDIR/scripts/test-morph" foreach git branch diff --git a/tests.branching/edit-clones-chunk.script b/tests.branching/edit-clones-chunk.script index ecc2c55e..d3324078 100755 --- a/tests.branching/edit-clones-chunk.script +++ b/tests.branching/edit-clones-chunk.script @@ -26,7 +26,7 @@ cd "$DATADIR/workspace" "$SRCDIR/scripts/test-morph" branch test:morphs newbranch # Edit chunk. -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum hello +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello echo "Current branches:" "$SRCDIR/scripts/test-morph" foreach git branch diff --git a/tests.branching/edit-handles-submodules.script b/tests.branching/edit-handles-submodules.script index 389784ed..72344119 100755 --- a/tests.branching/edit-handles-submodules.script +++ b/tests.branching/edit-handles-submodules.script @@ -26,7 +26,7 @@ cd "$DATADIR/workspace" "$SRCDIR/scripts/test-morph" branch test:morphs newbranch # Submodules should be set up automatically -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum hello +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello cd "$DATADIR/workspace/newbranch/test:hello" [ -e foolib/README ] diff --git a/tests.branching/edit-updates-stratum-build-depends.script b/tests.branching/edit-updates-stratum-build-depends.script index ed11b584..a108ce8a 100755 --- a/tests.branching/edit-updates-stratum-build-depends.script +++ b/tests.branching/edit-updates-stratum-build-depends.script @@ -63,7 +63,7 @@ cd "$DATADIR/workspace" "$SRCDIR/scripts/test-morph" branch test:morphs newbranch # Edit chunk. -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum hello +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello # See what effect the editing had. "$SRCDIR/scripts/run-git-in" "newbranch/test:morphs" diff 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.script b/tests.branching/edit-updates-stratum.script index 84974765..bfe16c8b 100755 --- a/tests.branching/edit-updates-stratum.script +++ b/tests.branching/edit-updates-stratum.script @@ -26,7 +26,7 @@ cd "$DATADIR/workspace" "$SRCDIR/scripts/test-morph" branch test:morphs newbranch # Edit chunk. -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum hello +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello # See what effect the editing had. "$SRCDIR/scripts/run-git-in" "newbranch/test:morphs" diff 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/edit-works-after-branch-root-was-renamed.script b/tests.branching/edit-works-after-branch-root-was-renamed.script index 9591b587..c7043e27 100755 --- a/tests.branching/edit-works-after-branch-root-was-renamed.script +++ b/tests.branching/edit-works-after-branch-root-was-renamed.script @@ -35,7 +35,7 @@ cd "$DATADIR/workspace" cd "$DATADIR/workspace/master" mv test:morphs my-renamed-morphs -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum hello +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello "$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' | sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' | diff --git a/tests.branching/petrify.script b/tests.branching/petrify.script index 9a276d71..fed8e965 100755 --- a/tests.branching/petrify.script +++ b/tests.branching/petrify.script @@ -29,7 +29,7 @@ cd "$DATADIR/workspace" cd test/petrify/test:morphs git push --quiet origin HEAD -"$SRCDIR/scripts/test-morph" new-edit hello-system hello-stratum goodbye +"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum goodbye (cd ../test:goodbye && git push --quiet origin HEAD) "$SRCDIR/scripts/test-morph" petrify 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 |