summaryrefslogtreecommitdiff
path: root/tests.branching/add-then-edit.script
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-08-29 11:48:50 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-08-30 10:34:53 +0000
commit2beadc4d94bd77e1794832c758b6174ff1ada0a6 (patch)
treea4edb67ad6a7158517ad230acedba12cb9b27bac /tests.branching/add-then-edit.script
parentb0096f15bb3624207b1df71b22070b4780b03658 (diff)
downloadmorph-2beadc4d94bd77e1794832c758b6174ff1ada0a6.tar.gz
edit: Unset defaults before writing
This also amends the test suite. The git apply command to alter the stratum proved inflexible when anything changed, so it has been replaced by a small in-line python script.
Diffstat (limited to 'tests.branching/add-then-edit.script')
-rwxr-xr-xtests.branching/add-then-edit.script29
1 files changed, 12 insertions, 17 deletions
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