From d63f41dadf5aa96a8d9254d31e92711ee160245e Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sun, 10 Aug 2014 20:29:40 +0100 Subject: Remove petrify and unpetrify commands We don't use this any more, and instead prefer to always keep definitions.git petrified, and update the refs ourselves. branch-from-image still uses some of the remaining petrify code. --- doc/branching-merging-systems.mdwn | 32 +---- morphlib/morphset.py | 14 -- morphlib/morphset_tests.py | 15 -- morphlib/plugins/branch_and_merge_plugin.py | 98 ------------- ...hology-contents-do-not-change-cache-keys.script | 45 ------ tests.branching.disabled/workflow-petrify.script | 67 --------- tests.branching.disabled/workflow-petrify.stdout | 152 --------------------- tests.branching/ambiguous-refs.script | 46 ------- tests.branching/build-after-petrify.script | 31 ----- tests.branching/petrify-no-double-petrify.script | 34 ----- tests.branching/petrify-no-double-petrify.stdout | 9 -- tests.branching/petrify.script | 42 ------ tests.branching/petrify.stdout | 31 ----- yarns/branches-workspaces.yarn | 35 ----- yarns/implementations.yarn | 48 ------- 15 files changed, 1 insertion(+), 698 deletions(-) delete mode 100755 tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script delete mode 100755 tests.branching.disabled/workflow-petrify.script delete mode 100644 tests.branching.disabled/workflow-petrify.stdout delete mode 100755 tests.branching/ambiguous-refs.script delete mode 100755 tests.branching/build-after-petrify.script delete mode 100755 tests.branching/petrify-no-double-petrify.script delete mode 100644 tests.branching/petrify-no-double-petrify.stdout delete mode 100755 tests.branching/petrify.script delete mode 100644 tests.branching/petrify.stdout diff --git a/doc/branching-merging-systems.mdwn b/doc/branching-merging-systems.mdwn index c2e24d77..3bc19aab 100644 --- a/doc/branching-merging-systems.mdwn +++ b/doc/branching-merging-systems.mdwn @@ -129,7 +129,7 @@ Also, clone the `morphs` git repository inside the system branch directory. cd ~/baserock/liw/foo/morphs - morph petrify base-system.morph devel-system.morph + edit base-system.morph devel-system.morph git commit -a Modify the specified morphologies (or the stratum morphologies they @@ -225,36 +225,6 @@ it to exist instead. * Run `git checkout BRANCH` in the `morphs` repository. -Implementation: `morph petrify` --------------- - -Usage: - - morph petrify [MORPH]... - morph petrify --petrify-from-system FILE - -This needs to be run in the `morphs` git repository in a system branch. - -In the first form: - -* read each of the given morphologies; if the morphology is a system one, - follow references to stratum morphologies and process those instead -* in each stratum morphology, replace a reference to a chunk with the - absolute SHA-1: if the original reference was, say, `baserock/morph`, - get the SHA-1 of the current tip commit in that branch and replace - the reference in the morphology - -In the second form: - -* extract the system and stratum morphologies used in the system image file; - these are in a petrified form already -* copy the morphologies to the current working directory, overwriting the - files from git - -In either case, the results need to be committed (with normal git commands) -by the user. - - Implementation: `morph edit` -------------- diff --git a/morphlib/morphset.py b/morphlib/morphset.py index 590ac51e..fa525973 100644 --- a/morphlib/morphset.py +++ b/morphlib/morphset.py @@ -243,17 +243,3 @@ class MorphologySet(object): return True self.traverse_specs(process_chunk_spec, wanted_chunk_spec) - - def unpetrify_all(self): - '''If a spec is petrified, unpetrify it. - - ''' - - def wanted_spec(m, kind, spec): - return ('unpetrify-ref' in spec and - morphlib.git.is_valid_sha1(spec.get('ref'))) - def process_spec(m, kind, spec): - spec['ref'] = spec.pop('unpetrify-ref') - return True - - self.traverse_specs(process_spec, wanted_spec) diff --git a/morphlib/morphset_tests.py b/morphlib/morphset_tests.py index 8679c64a..af1333d8 100644 --- a/morphlib/morphset_tests.py +++ b/morphlib/morphset_tests.py @@ -200,18 +200,3 @@ class MorphologySetTests(unittest.TestCase): 'unpetrify-ref': 'master', } ]) - - def test_unpetrify_all(self): - self.morphs.add_morphology(self.system) - self.morphs.add_morphology(self.stratum) - self.morphs.petrify_chunks({('test:foo-chunk', 'master'): '0'*40}) - self.morphs.unpetrify_all() - self.assertEqual( - self.stratum['chunks'], - [ - { - 'repo': 'test:foo-chunk', - 'ref': 'master', - 'morph': 'foo-chunk', - } - ]) diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index a66098b8..9450c67b 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -37,10 +37,6 @@ class BranchAndMergePlugin(cliapp.Plugin): 'branch', self.branch, arg_synopsis='REPO NEW [OLD]') self.app.add_subcommand( 'edit', self.edit, arg_synopsis='SYSTEM STRATUM [CHUNK]') - self.app.add_subcommand( - 'petrify', self.petrify, arg_synopsis='') - self.app.add_subcommand( - 'unpetrify', self.unpetrify, arg_synopsis='') self.app.add_subcommand( 'show-system-branch', self.show_system_branch, arg_synopsis='') self.app.add_subcommand( @@ -486,100 +482,6 @@ class BranchAndMergePlugin(cliapp.Plugin): morphs.add_morphology(morph) return morphs - def petrify(self, args): - '''Convert all chunk refs in a system branch to be fixed SHA1s. - - This modifies all git commit references in system and stratum - morphologies, in the current system branch, to be fixed SHA - commit identifiers, rather than symbolic branch or tag names. - This is useful for making sure none of the components in a system - branch change accidentally. - - Consider the following scenario: - - * The `master` system branch refers to `gcc` using the - `baserock/morph` ref. This is appropriate, since the main line - of development should use the latest curated code. - - * You create a system branch to prepare for a release, called - `TROVE_ID/release/2.0`. The reference to `gcc` is still - `baserock/morph`. - - * You test everything, and make a release. You deploy the release - images onto devices, which get shipped to your customers. - - * A new version GCC is committed to the `baserock/morph` branch. - - * Your release branch suddenly uses a new compiler, which may - or may not work for your particular system at that release. - - To avoid this, you need to _petrify_ all git references - so that they do not change accidentally. If you've tested - your release with the GCC release that is stored in commit - `94c50665324a7aeb32f3096393ec54b2e63bfb28`, then you should - continue to use that version of GCC, regardless of what might - happen in the master system branch. If, and only if, you decide - that a new compiler would be good for your release should you - include it in your release branch. This way, only the things - that you change intentionally change in your release branch. - - ''' - - if args: - raise cliapp.AppException('morph petrify takes no arguments') - - ws = morphlib.workspace.open('.') - sb = morphlib.sysbranchdir.open_from_within('.') - loader = morphlib.morphloader.MorphologyLoader() - lrc, rrc = morphlib.util.new_repo_caches(self.app) - update_repos = not self.app.settings['no-git-update'] - - morphs = self._load_all_sysbranch_morphologies(sb, loader) - - #TODO: Stop using app.resolve_ref - def resolve_refs(morphs): - for repo, ref in morphs.list_refs(): - # You can't resolve null refs, so don't attempt to. - if repo is None or ref is None: - continue - # TODO: Handle refs that are only in workspace in general - if (repo == sb.root_repository_url - and ref == sb.system_branch_name): - continue - commit_sha1, tree_sha1 = self.app.resolve_ref( - lrc, rrc, repo, ref, update=update_repos) - yield ((repo, ref), commit_sha1) - - morphs.repoint_refs(sb.root_repository_url, - sb.system_branch_name) - - morphs.petrify_chunks(dict(resolve_refs(morphs))) - - # Write morphologies back out again. - self._save_dirty_morphologies(loader, sb, morphs.morphologies) - - def unpetrify(self, args): - '''Reverse the process of petrification. - - This undoes the changes `morph petrify` did. - - ''' - - if args: - raise cliapp.AppException('morph petrify takes no arguments') - - ws = morphlib.workspace.open('.') - sb = morphlib.sysbranchdir.open_from_within('.') - loader = morphlib.morphloader.MorphologyLoader() - - morphs = self._load_all_sysbranch_morphologies(sb, loader) - - # Restore the ref for each stratum and chunk - morphs.unpetrify_all() - - # Write morphologies back out again. - self._save_dirty_morphologies(loader, sb, morphs.morphologies) - def status(self, args): '''Show information about the current system branch or workspace diff --git a/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script b/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script deleted file mode 100755 index a540cdee..00000000 --- a/tests.as-root/unimportant-morphology-contents-do-not-change-cache-keys.script +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2012-2014 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -## Some contents of morphologies (description, build-depends, chunks) -## should not change the cache keys of those morphs because they are -## either already considered (build-depends and chunks) or do not affect -## building (description). This test checks that changes to these parts -## of a morphology do not force rebuilds. - -# FIXME: This seems to break because the new "morph edit" makes correct -# changes to build-dependencies, which breaks the old "morph build". -# Disable test now, re-enable it after "morph build" is fixed. --liw -exit 0 - -set -eu - -source "$SRCDIR/tests.as-root/setup-build" - -# Build once. -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" build linux-system -ARTIFACT_COUNT="$(ls "$DATADIR/cache/artifacts" | wc -l)" - -# Petrify the refs, so the morphologies will be different -(set -e && cd branch1/test/morphs && git push --quiet origin HEAD) -(set -e && cd branch1/test/kernel-repo && git push --quiet origin HEAD) -"$SRCDIR/scripts/test-morph" petrify - -# Build with the petrified morphologies. -"$SRCDIR/scripts/test-morph" build linux-system -[ "$ARTIFACT_COUNT" -eq $(ls "$DATADIR/cache/artifacts" | wc -l) ] diff --git a/tests.branching.disabled/workflow-petrify.script b/tests.branching.disabled/workflow-petrify.script deleted file mode 100755 index 3c561d5b..00000000 --- a/tests.branching.disabled/workflow-petrify.script +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2014 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Do a complete workflow test, with strata outside the main morphologies -## repository. - -set -eu - -. "$SRCDIR/scripts/setup-3rd-party-strata" - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" branch test:morphs test/petrify - -cd test/petrify -"$SRCDIR/scripts/test-morph" petrify - -echo "test/petrify after petrifying:" -cat test:morphs/hello-system.morph -cat test:external-strata/stratum2.morph -cat test:external-strata/stratum3.morph - -"$SRCDIR/scripts/test-morph" edit hello - -echo -echo "test/petrify after editing a chunk:" -cat test:morphs/hello-system.morph -cat test:external-strata/stratum2.morph -cat test:external-strata/stratum3.morph - -# me/readme-fixes in test:stratum2-hello should be 'master', but -# that's the only ref upstream so we can infer that it is if we got here - -cd test:morphs -git commit --quiet --all -m "Petrify branch test/petrify" -git push --quiet origin test/petrify -cd ../test:external-strata -git commit --quiet --all -m "Petrify branch test/petrify" -git push --quiet origin test/petrify - -# unpetrify is easy enough. Let's try unpetrifying a different branch that -# was forked off the original while it was petrified, instead. -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" branch test:morphs test/unpetrify test/petrify - -cd test/unpetrify -"$SRCDIR/scripts/test-morph" unpetrify - -echo -echo "test/unpetrify after unpetrifying:" -cat test:morphs/hello-system.morph -cat test:external-strata/stratum2.morph -cat test:external-strata/stratum3.morph diff --git a/tests.branching.disabled/workflow-petrify.stdout b/tests.branching.disabled/workflow-petrify.stdout deleted file mode 100644 index a0ce82f4..00000000 --- a/tests.branching.disabled/workflow-petrify.stdout +++ /dev/null @@ -1,152 +0,0 @@ -test/petrify after petrifying: -{ - "name": "hello-system", - "kind": "system", - "arch": "x86_64", - "strata": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "test/petrify" - }, - { - "morph": "stratum2", - "repo": "test:external-strata", - "ref": "test/petrify" - }, - { - "morph": "stratum3", - "repo": "test:external-strata", - "ref": "test/petrify" - } - ] -} -{ - "name": "stratum2", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:stratum2-hello", - "ref": "f4730636e429149bb923fa16be3aa9802d484b23", - "build-mode": "test", - "build-depends": [], - "unpetrify-ref": "master" - } - ] -} -{ - "name": "stratum3", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:stratum3-hello", - "ref": "f4730636e429149bb923fa16be3aa9802d484b23", - "build-mode": "test", - "build-depends": [], - "unpetrify-ref": "master" - } - ] -} - -test/petrify after editing a chunk: -{ - "name": "hello-system", - "kind": "system", - "arch": "x86_64", - "strata": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "test/petrify" - }, - { - "morph": "stratum2", - "repo": "test:external-strata", - "ref": "test/petrify" - }, - { - "morph": "stratum3", - "repo": "test:external-strata", - "ref": "test/petrify" - } - ] -} -{ - "name": "stratum2", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:stratum2-hello", - "ref": "test/petrify", - "build-mode": "test", - "build-depends": [] - } - ] -} -{ - "name": "stratum3", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:stratum3-hello", - "ref": "f4730636e429149bb923fa16be3aa9802d484b23", - "build-mode": "test", - "build-depends": [], - "unpetrify-ref": "master" - } - ] -} - -test/unpetrify after unpetrifying: -{ - "name": "hello-system", - "kind": "system", - "arch": "x86_64", - "strata": [ - { - "morph": "hello-stratum", - "repo": "test:morphs", - "ref": "test/unpetrify" - }, - { - "morph": "stratum2", - "repo": "test:external-strata", - "ref": "test/unpetrify" - }, - { - "morph": "stratum3", - "repo": "test:external-strata", - "ref": "test/unpetrify" - } - ] -} -{ - "name": "stratum2", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:stratum2-hello", - "ref": "test/petrify", - "build-mode": "test", - "build-depends": [] - } - ] -} -{ - "name": "stratum3", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:stratum3-hello", - "ref": "master", - "build-mode": "test", - "build-depends": [] - } - ] -} diff --git a/tests.branching/ambiguous-refs.script b/tests.branching/ambiguous-refs.script deleted file mode 100755 index aeec61a1..00000000 --- a/tests.branching/ambiguous-refs.script +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2014 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Guard against a bug that occurs if 'git show-ref' is used to resolve refs -## instead of 'git rev-parse --verify': show-ref returns a list of partial -## matches sorted alphabetically, so any code using it may resolve refs -## incorrectly. - -set -eu - -. "$SRCDIR/scripts/fix-committer-info" - -cd "$DATADIR/morphs" -git mv hello-stratum.morph goodbye-stratum.morph -sed -e '/morph: hello-stratum/s/hello-stratum/goodbye-stratum/' \ - -i hello-system.morph - -git commit --quiet -am "Rename hello-system" - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs release - -# Create an extra ref to confuse any users of git show-ref -cd release/test/morphs -git checkout --quiet -b alpha/master HEAD~1 -git checkout --quiet release - -# The petrify will fail if we resolved 'master' as 'alpha/master' by mistake. -cd "$DATADIR/workspace/release/test/morphs" -"$SRCDIR/scripts/test-morph" petrify diff --git a/tests.branching/build-after-petrify.script b/tests.branching/build-after-petrify.script deleted file mode 100755 index d3b75f07..00000000 --- a/tests.branching/build-after-petrify.script +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Verify systems can be built after "morph petrify" - -set -eu - -. "$SRCDIR/tests.branching/setup-second-chunk" - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs test/build-petrify master - -"$SRCDIR/scripts/test-morph" petrify - -"$SRCDIR/scripts/test-morph" build hello-system diff --git a/tests.branching/petrify-no-double-petrify.script b/tests.branching/petrify-no-double-petrify.script deleted file mode 100755 index 3c9185dc..00000000 --- a/tests.branching/petrify-no-double-petrify.script +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2014 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## It should be impossible to lose the original refs, or we risk making -## unpetrify impossible. - -set -eu - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs test/petrify - -cd test/petrify/test/morphs -git push --quiet origin HEAD -"$SRCDIR/scripts/test-morph" petrify -"$SRCDIR/scripts/test-morph" petrify -"$SRCDIR/scripts/test-morph" petrify - -cat hello-stratum.morph diff --git a/tests.branching/petrify-no-double-petrify.stdout b/tests.branching/petrify-no-double-petrify.stdout deleted file mode 100644 index 50da61ba..00000000 --- a/tests.branching/petrify-no-double-petrify.stdout +++ /dev/null @@ -1,9 +0,0 @@ -name: hello-stratum -kind: stratum -chunks: -- name: hello - repo: test:hello - ref: 293fa0b08f0382c63181c36b6efa602876aa8c87 - unpetrify-ref: master - build-depends: [] - build-mode: test diff --git a/tests.branching/petrify.script b/tests.branching/petrify.script deleted file mode 100755 index f8e7c1e9..00000000 --- a/tests.branching/petrify.script +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2014 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Verify "morph petrify", and ensure it doesn't petrify chunks that have -## already been edited. - -set -eu - -. "$SRCDIR/tests.branching/setup-second-chunk" - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs test/petrify master - -cd test/petrify/test/morphs -git push --quiet origin HEAD -"$SRCDIR/scripts/test-morph" edit goodbye -(cd ../goodbye && git push --quiet origin HEAD) - -"$SRCDIR/scripts/test-morph" petrify -echo "Petrified:" -cat hello-stratum.morph - -"$SRCDIR/scripts/test-morph" unpetrify -echo -echo "Unpetrified:" -cat hello-stratum.morph diff --git a/tests.branching/petrify.stdout b/tests.branching/petrify.stdout deleted file mode 100644 index f9f35342..00000000 --- a/tests.branching/petrify.stdout +++ /dev/null @@ -1,31 +0,0 @@ -Petrified: -name: hello-stratum -kind: stratum -chunks: -- name: hello - repo: test:hello - ref: 293fa0b08f0382c63181c36b6efa602876aa8c87 - unpetrify-ref: master - build-depends: [] - build-mode: test -- name: goodbye - repo: test:goodbye - ref: 717c4a523fb5a94ca2f0a61e665fbc2da6a1f6ac - unpetrify-ref: test/petrify - build-depends: [] - build-mode: test - -Unpetrified: -name: hello-stratum -kind: stratum -chunks: -- name: hello - repo: test:hello - ref: master - build-depends: [] - build-mode: test -- name: goodbye - repo: test:goodbye - ref: test/petrify - build-depends: [] - build-mode: test diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index 642beadd..995a9450 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -406,41 +406,6 @@ branch checkout. THEN morph ran command in test/morphs in foo AND morph ran command in test/test-chunk in foo -Explicit petrification ----------------------- - -We petrify branches explicitly (though this may later change so that -`morph branch` does it automatically). To test this, we create a branch, -petrify it, and verify that every ref looks like a SHA1. We then -unpetrify and verify that we have all the same refs as before. - - SCENARIO morph petrifies and unpetrifies - GIVEN a workspace - AND a git server - WHEN the user creates a system branch called foo - AND the user pushes the system branch called foo to the git server - AND remembering all refs in foo - AND petrifying foo - THEN foo is petrified - -Petrifying a morphology should not cause it to start having repo or ref -fields when referring to strata, when it didn't before. - - AND in branch foo, system systems/test-system.morph refers to test-stratum without repo - AND in branch foo, system systems/test-system.morph refers to test-stratum without ref - -Unpetrify must put the morphologies back in the same logical state they -were in before. - - WHEN unpetrifying foo - THEN foo refs are as remembered - -Unpetrifying a morphology should not cause it to start having repo or -ref fields when referring to strata, when it didn't before. - - AND in branch foo, system systems/test-system.morph refers to test-stratum without repo - AND in branch foo, system systems/test-system.morph refers to test-stratum without ref - Generating a manifest works SCENARIO morph generates a manifest diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index a28fda54..24f67a1b 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -518,54 +518,6 @@ Running shell command in each checked out repository: grep -Fx "$MATCH_1" "$DATADIR/morph.stdout" grep -Fx "$DATADIR/workspace/$MATCH_2/$MATCH_1" "$DATADIR/morph.stdout" -Petrification and unpetrification: - - IMPLEMENTS WHEN remembering all refs in (\S+) - cd "$DATADIR/workspace/$MATCH_1/test/morphs" - list_refs $(find . -type f) > "$DATADIR/refs.remembered" - - IMPLEMENTS THEN (\S+) refs are as remembered - cd "$DATADIR/workspace/$MATCH_1/test/morphs" - - # FIXME: petrify/unpetrify doesn't work quite right at this time: - # petrify can change a ref to a stratum to point at the system - # branch, but does it without adding an unpetrify-ref, and so - # unpetrify doesn't undo the change. We ignore this bug for the - # time being, in order to make the test suite pass. When the - # petrification code has been cleaned up to not be so hairy, - # we'll fix the test and the code. - # - # We would like to verify the result like this: - # - # list_refs $(find . -type f) > "$DATADIR/refs.now" - # diff -u "$DATADIR/refs.remembered" "$DATADIR/refs.now" - # - # However, due to the bug, we have to do it in a more complicated - # manner. - - list_refs $(find . -type f) | - while read filename ref - do - orig=$(awk -v "f=$filename" '$1 == f { print $2 }' \ - "$DATADIR/refs.remembered") - if [ "$orig" != "$ref" ] && [ "$ref" != "$MATCH_1" ] - then - die "Un-petrified ref: $filename $ref (should be $orig)" - fi - done - - IMPLEMENTS WHEN petrifying (\S+) - cd "$DATADIR/workspace/$MATCH_1/test/morphs" - run_morph petrify - - IMPLEMENTS WHEN unpetrifying (\S+) - cd "$DATADIR/workspace/$MATCH_1/test/morphs" - run_morph unpetrify - - IMPLEMENTS THEN (\S+) is petrified - cd "$DATADIR/workspace/$MATCH_1/test/morphs" - assert_morphologies_are_petrified "$MATCH_1" $(find . -type f) - Generating a manifest. IMPLEMENTS GIVEN a system artifact -- cgit v1.2.1 From 4d794d475e01363928916f7667a63eed6071f5e2 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sun, 10 Aug 2014 20:29:41 +0100 Subject: yarns: Start from petrified refs This is closer to our current workflow, where we are always petrified and update the ref field when we need to update a component. This required rearranging the operations to create the chunk repository before the definitions repository, and remove a check that assumes we weren't already petrified. --- yarns/branches-workspaces.yarn | 1 - yarns/implementations.yarn | 53 ++++++++++++++++++++++-------------------- yarns/regression.yarn | 3 ++- yarns/splitting.yarn | 9 ++++--- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index 995a9450..2f617ce4 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -178,7 +178,6 @@ all the refs are unchanged. GIVEN a workspace AND a git server WHEN the user creates a system branch called foo - THEN in branch foo, stratum strata/test-stratum.morph refs test-chunk in master Edit the chunk. We make use of special knowledge here: `test:test-chunk` is a chunk repository created in the mocked git server, for testing diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 24f67a1b..66dd9d57 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -67,7 +67,28 @@ another to hold a chunk. # Create a directory for all the git repositories. mkdir "$DATADIR/gits" - # Create a repo for the system and stratum morphologies. + # Create the chunk repository. + + mkdir "$DATADIR/gits/test-chunk" + + run_in "$DATADIR/gits/test-chunk" git init . + cat > "$DATADIR/gits/test-chunk/test-bin" <<'EOF' + #!/bin/sh + echo Hello World + EOF + cat > "$DATADIR/gits/test-chunk/test.h" <<'EOF' + int foo(void); + EOF + cat > "$DATADIR/gits/test-chunk/test.pc" <<'EOF' + prefix=/usr + includedir=${prefix}/include + Name: test + Cflags: -I{includedir} + EOF + run_in "$DATADIR/gits/test-chunk" git add . + run_in "$DATADIR/gits/test-chunk" git commit --allow-empty -m Initial. + + # Create a repo for the morphologies. mkdir "$DATADIR/gits/morphs" @@ -88,15 +109,12 @@ another to hold a chunk. - name: test-chunk repo: test:test-chunk morph: test-chunk.morph - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: test build-depends: [] EOF - # Create the chunk repository. - - mkdir "$DATADIR/gits/test-chunk" - # To verify that chunk splitting works, we have a chunk that installs # dummy files in all the places that different kinds of files are # usually installed. e.g. executables in `/bin` and `/usr/bin` @@ -240,23 +258,6 @@ another to hold a chunk. run_in "$DATADIR/gits/morphs" git commit -m Initial. run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag" - run_in "$DATADIR/gits/test-chunk" git init . - cat > "$DATADIR/gits/test-chunk/test-bin" <<'EOF' - #!/bin/sh - echo Hello World - EOF - cat > "$DATADIR/gits/test-chunk/test.h" <<'EOF' - int foo(void); - EOF - cat > "$DATADIR/gits/test-chunk/test.pc" <<'EOF' - prefix=/usr - includedir=${prefix}/include - Name: test - Cflags: -I{includedir} - EOF - run_in "$DATADIR/gits/test-chunk" git add . - run_in "$DATADIR/gits/test-chunk" git commit --allow-empty -m Initial. - # Create the Morph configuration file so we can access the repos # using test:foo URL aliases. @@ -293,7 +294,8 @@ have a morphology using the test architecture. - name: stage1-chunk morph: stage1-chunk.morph repo: test:test-chunk - ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) + unpetrify-ref: master build-mode: bootstrap build-depends: [] EOF @@ -307,7 +309,8 @@ have a morphology using the test architecture. - name: test-chunk morph: test-chunk.morph repo: test:test-chunk - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: test build-depends: [] EOF diff --git a/yarns/regression.yarn b/yarns/regression.yarn index e5b3d875..6f499d90 100644 --- a/yarns/regression.yarn +++ b/yarns/regression.yarn @@ -90,7 +90,8 @@ Implementations - name: bootstrap-chunk morph: bootstrap-chunk.morph repo: test:test-chunk - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: bootstrap build-depends: [] EOF diff --git a/yarns/splitting.yarn b/yarns/splitting.yarn index 1b67a881..d4b942d8 100644 --- a/yarns/splitting.yarn +++ b/yarns/splitting.yarn @@ -141,7 +141,8 @@ Implementations chunks: - name: test-chunk repo: test:test-chunk - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) morph: test-chunk.morph build-mode: test build-depends: [] @@ -189,13 +190,15 @@ Implementations chunks: - name: test-chunk repo: test:test-chunk - ref: master morph: test-chunk.morph + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: test build-depends: [] - name: unbuildable-chunk repo: test:test-chunk - ref: refs/heads/master + unpetrify-ref: refs/heads/master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) morph: unbuildable-chunk.morph build-mode: test build-depends: -- cgit v1.2.1 From 2e5d8664920453ede30b450c7b39ac3a0bc141bb Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sun, 10 Aug 2014 20:29:42 +0100 Subject: Make morph show-branch-root print the path The help for the show-branch-root command said it returns a path, but the command and the yarns just showed the aliased url it was cloned from. Given I found myself needing the path in some scripts, not the repo url, I think it's more useful to reconcile the difference this way. --- morphlib/plugins/branch_and_merge_plugin.py | 7 ++-- morphlib/sysbranchdir.py | 38 +++++++++++++++------- .../show-branch-root-in-branched-branch.script | 30 ----------------- .../show-branch-root-in-branched-branch.stdout | 1 - .../show-branch-root-in-checked-out-branch.script | 30 ----------------- .../show-branch-root-in-checked-out-branch.stdout | 1 - .../show-branch-root-with-repo-url.script | 30 ----------------- .../show-branch-root-with-repo-url.stdout | 1 - yarns/branches-workspaces.yarn | 10 +++--- yarns/implementations.yarn | 2 +- 10 files changed, 36 insertions(+), 114 deletions(-) delete mode 100755 tests.branching/show-branch-root-in-branched-branch.script delete mode 100644 tests.branching/show-branch-root-in-branched-branch.stdout delete mode 100755 tests.branching/show-branch-root-in-checked-out-branch.script delete mode 100644 tests.branching/show-branch-root-in-checked-out-branch.stdout delete mode 100755 tests.branching/show-branch-root-with-repo-url.script delete mode 100644 tests.branching/show-branch-root-with-repo-url.stdout diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 9450c67b..434ff6af 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -373,16 +373,17 @@ class BranchAndMergePlugin(cliapp.Plugin): This would, for example, write out something like: - /src/ws/master/baserock:baserock/morphs + /src/ws/master/baserock/baserock/morphs - when the master branch of the `baserock:baserock/morphs` + when the master branch of the `baserock/baserock/morphs` repository is checked out. ''' ws = morphlib.workspace.open('.') sb = morphlib.sysbranchdir.open_from_within('.') - self.app.output.write('%s\n' % sb.get_config('branch.root')) + repo_url = sb.get_config('branch.root') + self.app.output.write('%s\n' % sb.get_git_directory_name(repo_url)) def _remove_branch_dir_safe(self, workspace_root, system_branch_root): # This function avoids throwing any exceptions, so it is safe to call diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py index b8953c2f..19fba695 100644 --- a/morphlib/sysbranchdir.py +++ b/morphlib/sysbranchdir.py @@ -68,19 +68,13 @@ class SystemBranchDirectory(object): value = cliapp.runcmd(['git', 'config', '-f', self._config_path, key]) return value.strip() - def get_git_directory_name(self, repo_url): - '''Return directory pathname for a given git repository. - - If the URL is a real one (not aliased), the schema and leading // - are removed from it, as is a .git suffix. - - Any colons in the URL path or network location are replaced - with slashes, so that directory paths do not contain colons. - This avoids problems with PYTHONPATH, PATH, and other things - that use colon as a separator. - - ''' + def _find_git_directory(self, repo_url): + for gd in self.list_git_directories(): + if gd.get_config('morph.repository') == repo_url: + return gd.dirname + return None + def _fabricate_git_directory_name(self, repo_url): # Parse the URL. If the path component is absolute, we assume # it's a real URL; otherwise, an aliased URL. parts = urlparse.urlparse(repo_url) @@ -107,6 +101,26 @@ class SystemBranchDirectory(object): return os.path.join(self.root_directory, relative) + def get_git_directory_name(self, repo_url): + '''Return directory pathname for a given git repository. + + If the repository has already been cloned, then it returns the + path to that, if not it will fabricate a path based on the url. + + If the URL is a real one (not aliased), the schema and leading // + are removed from it, as is a .git suffix. + + Any colons in the URL path or network location are replaced + with slashes, so that directory paths do not contain colons. + This avoids problems with PYTHONPATH, PATH, and other things + that use colon as a separator. + + ''' + found_repo = self._find_git_directory(repo_url) + if not found_repo: + return self._fabricate_git_directory_name(repo_url) + return found_repo + def get_filename(self, repo_url, relative): '''Return full pathname to a file in a checked out repository. diff --git a/tests.branching/show-branch-root-in-branched-branch.script b/tests.branching/show-branch-root-in-branched-branch.script deleted file mode 100755 index 4598d6a9..00000000 --- a/tests.branching/show-branch-root-in-branched-branch.script +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Check that 'morph show-branch-root' works when being run in a -## local system branch created using 'morph branch ...'. - -set -eu - -# Create a workspace and branch. -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs testbranch - -# Try to print the branch root repository. -"$SRCDIR/scripts/test-morph" show-branch-root diff --git a/tests.branching/show-branch-root-in-branched-branch.stdout b/tests.branching/show-branch-root-in-branched-branch.stdout deleted file mode 100644 index b2804d56..00000000 --- a/tests.branching/show-branch-root-in-branched-branch.stdout +++ /dev/null @@ -1 +0,0 @@ -test:morphs diff --git a/tests.branching/show-branch-root-in-checked-out-branch.script b/tests.branching/show-branch-root-in-checked-out-branch.script deleted file mode 100755 index 97f892b9..00000000 --- a/tests.branching/show-branch-root-in-checked-out-branch.script +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Check that 'morph show-branch-root' works when being run in a -## local system branch created using 'morph checkout ...'. - -set -eu - -# Create a workspace and branch. -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" checkout test:morphs master - -# Try to print the branch root repository. -"$SRCDIR/scripts/test-morph" show-branch-root diff --git a/tests.branching/show-branch-root-in-checked-out-branch.stdout b/tests.branching/show-branch-root-in-checked-out-branch.stdout deleted file mode 100644 index b2804d56..00000000 --- a/tests.branching/show-branch-root-in-checked-out-branch.stdout +++ /dev/null @@ -1 +0,0 @@ -test:morphs diff --git a/tests.branching/show-branch-root-with-repo-url.script b/tests.branching/show-branch-root-with-repo-url.script deleted file mode 100755 index 5480c3ef..00000000 --- a/tests.branching/show-branch-root-with-repo-url.script +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -## Check that 'morph show-branch-root' works when being run in a -## local system branch created from a full repository URL. - -set -eu - -# Create a workspace and branch. -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch "file://${DATADIR}/morphs.git" testbranch - -# Try to print the branch root repository. -"$SRCDIR/scripts/test-morph" show-branch-root diff --git a/tests.branching/show-branch-root-with-repo-url.stdout b/tests.branching/show-branch-root-with-repo-url.stdout deleted file mode 100644 index 2d47eb40..00000000 --- a/tests.branching/show-branch-root-with-repo-url.stdout +++ /dev/null @@ -1 +0,0 @@ -file://TMP/morphs.git diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index 2f617ce4..25ea7365 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -142,19 +142,19 @@ current directory, things should fail. AND the user attempts to report the system branch from the directory . THEN morph failed -`morph show-branch-root` reports the URL (possibly aliases) of the -system branch root repository. It can be run inside a checkout, or -somewhere outside a checkout, where exactly one checkout exists below. +`morph show-branch-root` reports the path of the system branch root +repository. It can be run inside a checkout, or somewhere outside a +checkout, where exactly one checkout exists below. SCENARIO morph reports system branch root repository GIVEN a workspace AND a git server WHEN the user checks out the system branch called master AND the user reports the system branch root repository from the directory master - THEN the system branch root repository is reported as test:morphs + THEN the system branch root repository is reported as workspace/master/test/morphs WHEN the user reports the system branch root repository from the directory . - THEN the system branch root repository is reported as test:morphs + THEN the system branch root repository is reported as workspace/master/test/morphs However, it fails if run outside a checkout and there's no system branches checked out. diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 66dd9d57..d2e72ccf 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -419,7 +419,7 @@ Report system branch root repository. else attempt_morph show-branch-root > "$@"; fi IMPLEMENTS THEN the system branch root repository is reported as (.*) - echo "$MATCH_1" > "$DATADIR/branch-root.actual" + echo "$DATADIR/$MATCH_1" > "$DATADIR/branch-root.actual" diff -u "$DATADIR/branch-root.actual" "$DATADIR/branch-root.reported" Editing morphologies with `morph edit`. -- cgit v1.2.1 From 0f9c9e2ff3c9afe00735fa986200ac5fdcc8f79e Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sun, 10 Aug 2014 20:29:43 +0100 Subject: Fix `morph edit` when repo has the same ref as system branch There was a check in it to see whether it needed to do the git branch and git checkout based on whether the name of the branch matched that in the morphology. This had a couple of problems: 1. Now that we aren't always building from HEAD, we need to be able to roll its commit back, so using the existing branch isn't always the best idea. 2. It only checks the "ref" field, not "unpetrify-ref", so even though we clone the right ref in there, it's checking the commit id against the system branch name, so would always try to re-create the branch, and fail when it already exists. So now, we remove the original ref and re-create it with our preferred HEAD. A better solution might be to change the clone logic to not automatically checkout HEAD, and instead require an explicit branch then checkout, but the initial clone logic is shared with build, and I didn't feel like tracking down all the different places that it was used. --- morphlib/gitdir.py | 13 +++++++++++-- morphlib/plugins/branch_and_merge_plugin.py | 14 +++++++++++--- yarns/branches-workspaces.yarn | 11 ++++++++++- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py index 3966a0f0..fea26c2e 100644 --- a/morphlib/gitdir.py +++ b/morphlib/gitdir.py @@ -495,8 +495,17 @@ class GitDirectory(object): raise InvalidRefError(self, ref) def disambiguate_ref(self, ref): # pragma: no cover - out = self._runcmd(['git', 'rev-parse', '--symbolic-full-name', ref]) - return out.strip() + try: + out = self._runcmd(['git', 'rev-parse', '--symbolic-full-name', + ref]) + return out.strip() + except cliapp.AppException: # ref not found + if ref.startswith('refs/heads/'): + return ref + elif ref.startswith('heads/'): + return 'refs/' + ref + else: + return 'refs/heads/' + ref def resolve_ref_to_commit(self, ref): return self._rev_parse('%s^{commit}' % ref) diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 434ff6af..36f720aa 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -309,9 +309,17 @@ class BranchAndMergePlugin(cliapp.Plugin): cached_repo = lrc.get_updated_repo(chunk_url) gd = sb.clone_cached_repo(cached_repo, chunk_ref) - if chunk_ref != sb.system_branch_name: - gd.branch(sb.system_branch_name, chunk_ref) - gd.checkout(sb.system_branch_name) + system_branch_ref = gd.disambiguate_ref(sb.system_branch_name) + sha1 = gd.resolve_ref_to_commit(chunk_ref) + + try: + old_sha1 = gd.resolve_ref_to_commit(system_branch_ref) + except morphlib.gitdir.InvalidRefError as e: + pass + else: + gd.delete_ref(system_branch_ref, old_sha1) + gd.branch(sb.system_branch_name, sha1) + gd.checkout(sb.system_branch_name) gd.update_submodules(self.app) gd.update_remotes() if gd.has_fat(): diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index 25ea7365..7c85d6e0 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -39,7 +39,7 @@ existing workspace, initialising it should fail. WHEN the user attempts to initialise a workspace THEN morph failed -Checking out or branching system branches +Checking out system branches ----------------------------------------- Once we have a workspace, we can check out a system branch. @@ -50,6 +50,12 @@ Once we have a workspace, we can check out a system branch. WHEN the user checks out the system branch called master THEN the system branch master is checked out +Edit is probably not the best name for is, but we can use `morph edit` +to investigate chunks in existing branches. + + WHEN the user edits the chunk test-chunk in branch master + THEN the edited chunk test:test-chunk has git branch master + Checking out a system branch should fail, if the branch doesn't exist. SCENARIO checking out a system branch that doesn't exist @@ -58,6 +64,9 @@ Checking out a system branch should fail, if the branch doesn't exist. WHEN the user attempts to check out the system branch called foo THEN morph failed +Branching system branches +----------------------------------------- + We can, instead, create a new system branch, off master. SCENARIO branch off master -- cgit v1.2.1