From b16e99a71980e9f10ff719d749ad8e453704ea83 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 2 Sep 2013 13:32:47 +0000 Subject: MorphSet: keep old ref as unpetrify-ref This makes petrify much simpler, since adding unpetrify-ref is handled by MorphSet. This has the side-effect of adding unpetrify-ref when editing, but this information is also useful for this use-case. The edit tests now have different diffs and commits, so those have been updated. Also, the old merge code currently warns that now there appears to be petrified changes, since it detects if a branch is petrified by the presence of the unpetrify-ref field, even though the ref is not a SHA1. The old code does not handle undoing an edit the new way, so I did not feel it was worth attempting to comprehend it to fix this bug, which will be later fixed by the introduction of the new merge code. --- .../edit-updates-stratum-build-depends.stdout | 16 ++++++++++------ tests.branching/edit-updates-stratum.stdout | 10 ++++++---- tests.branching/workflow.stdout | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 tests.branching/workflow.stdout (limited to 'tests.branching') diff --git a/tests.branching/edit-updates-stratum-build-depends.stdout b/tests.branching/edit-updates-stratum-build-depends.stdout index 00b303bd..1c6eb8e3 100644 --- a/tests.branching/edit-updates-stratum-build-depends.stdout +++ b/tests.branching/edit-updates-stratum-build-depends.stdout @@ -1,46 +1,50 @@ diff --git a/hello-stratum.morph b/hello-stratum.morph -index 73ed482..3731d63 100644 +index 73ed482..475fe0f 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -2,7 +2,7 @@ chunks: +@@ -2,7 +2,8 @@ chunks: - build-depends: [] build-mode: test name: hello - ref: master + ref: newbranch repo: test:hello ++ unpetrify-ref: master kind: stratum name: hello-stratum diff --git a/hello-system.morph b/hello-system.morph -index 721473c..94c1837 100644 +index 721473c..1537f53 100644 --- a/hello-system.morph +++ b/hello-system.morph -@@ -3,9 +3,8 @@ kind: system +@@ -3,9 +3,9 @@ kind: system name: hello-system strata: - morph: hello-stratum - ref: master + ref: newbranch repo: test:morphs ++ unpetrify-ref: master - morph: xyzzy-stratum ref: master repo: test:morphs -system-kind: rootfs-tarball diff --git a/xyzzy-stratum.morph b/xyzzy-stratum.morph -index e302037..97f7208 100644 +index e302037..bcf5b57 100644 --- a/xyzzy-stratum.morph +++ b/xyzzy-stratum.morph -@@ -1,11 +1,11 @@ +@@ -1,11 +1,13 @@ build-depends: - morph: hello-stratum - ref: master + ref: newbranch repo: test:morphs ++ unpetrify-ref: master chunks: - build-depends: [] name: hello - ref: master + ref: newbranch repo: test:hello ++ unpetrify-ref: master kind: stratum name: xyzzy-stratum diff --git a/tests.branching/edit-updates-stratum.stdout b/tests.branching/edit-updates-stratum.stdout index e84dbe09..32eb820d 100644 --- a/tests.branching/edit-updates-stratum.stdout +++ b/tests.branching/edit-updates-stratum.stdout @@ -1,21 +1,22 @@ diff --git a/hello-stratum.morph b/hello-stratum.morph -index 73ed482..3731d63 100644 +index 73ed482..475fe0f 100644 --- a/hello-stratum.morph +++ b/hello-stratum.morph -@@ -2,7 +2,7 @@ chunks: +@@ -2,7 +2,8 @@ chunks: - build-depends: [] build-mode: test name: hello - ref: master + ref: newbranch repo: test:hello ++ unpetrify-ref: master kind: stratum name: hello-stratum diff --git a/hello-system.morph b/hello-system.morph -index b0fed3b..801a955 100644 +index b0fed3b..199c924 100644 --- a/hello-system.morph +++ b/hello-system.morph -@@ -3,6 +3,5 @@ kind: system +@@ -3,6 +3,6 @@ kind: system name: hello-system strata: - morph: hello-stratum @@ -23,3 +24,4 @@ index b0fed3b..801a955 100644 + ref: newbranch repo: test:morphs -system-kind: rootfs-tarball ++ unpetrify-ref: master diff --git a/tests.branching/workflow.stdout b/tests.branching/workflow.stdout new file mode 100644 index 00000000..65985486 --- /dev/null +++ b/tests.branching/workflow.stdout @@ -0,0 +1 @@ +WARNING: chunk "hello-system.hello-stratum.hello" is now petrified -- cgit v1.2.1 From 4db444d0fc239eb74d11e8ebcfb50aa3e79ad500 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 2 Sep 2013 13:37:53 +0000 Subject: b&m: Re-implement morph petrify This includes amending the test suite to use the old petrify, since the old unpetrify depends on some implementation details of it. --- tests.branching/petrify.script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests.branching') diff --git a/tests.branching/petrify.script b/tests.branching/petrify.script index fed8e965..3134ab66 100755 --- a/tests.branching/petrify.script +++ b/tests.branching/petrify.script @@ -32,7 +32,7 @@ git push --quiet origin HEAD "$SRCDIR/scripts/test-morph" edit hello-system hello-stratum goodbye (cd ../test:goodbye && git push --quiet origin HEAD) -"$SRCDIR/scripts/test-morph" petrify +"$SRCDIR/scripts/test-morph" old-petrify echo "Petrified:" cat hello-stratum.morph -- cgit v1.2.1 From 1bedfa7749300da167808b837d2a8968df43eeb3 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 3 Sep 2013 16:35:36 +0000 Subject: b&m: re-implement morph unpetrify This also undoes the test suite change to keep it using the old petrify. Petrify and Unpetrify have the same structure: 1. Set up 2. Load all the morphologies 3. Make changes to the morphologies 4. Write back any changes This suggests some re-use in the form of passing a function callback to a morphology visitor. --- tests.branching/petrify.script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests.branching') diff --git a/tests.branching/petrify.script b/tests.branching/petrify.script index 3134ab66..fed8e965 100755 --- a/tests.branching/petrify.script +++ b/tests.branching/petrify.script @@ -32,7 +32,7 @@ git push --quiet origin HEAD "$SRCDIR/scripts/test-morph" edit hello-system hello-stratum goodbye (cd ../test:goodbye && git push --quiet origin HEAD) -"$SRCDIR/scripts/test-morph" old-petrify +"$SRCDIR/scripts/test-morph" petrify echo "Petrified:" cat hello-stratum.morph -- cgit v1.2.1