diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-09-30 14:10:38 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-09-30 14:10:38 +0000 |
commit | 8f21a1bd9bf4f89583ff32c7c01bc181e34880f4 (patch) | |
tree | 7dc303849ec557d69ae18342582ac8f67fb86e85 /yarns | |
parent | 3d93d272079b602aefe5d3bcd660d4a3307f3aad (diff) | |
parent | 1f4f3f5782f0c0d53beccf0d4b7be2eed1dd0c35 (diff) | |
download | morph-8f21a1bd9bf4f89583ff32c7c01bc181e34880f4.tar.gz |
Merge remote-tracking branch 'origin/baserock/richardmaw/S8938/null-repo-ref'
Reviewed-by: Lars Wirzenius
Reviewed-by: Jonathan Maw
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/branches-workspaces.yarn | 62 | ||||
-rw-r--r-- | yarns/implementations.yarn | 12 | ||||
-rw-r--r-- | yarns/morph.shell-lib | 5 |
3 files changed, 79 insertions, 0 deletions
diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index 5273f396..f523ebcd 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -290,3 +290,65 @@ Creating a tag twice should fail. WHEN attempting to tag system branch foo as test123 THEN morph failed +Working with null repositories and refs +--------------------------------------- + +It is convenient to not explicitly name the repository and branch of +a stratum morphology, instead assuming it is the same as the current +morphology. + +These can be checked out like normal system branches. + + SCENARIO check out an existing system branch with null refs + GIVEN a workspace + AND a git server + AND null refs for local strata + WHEN checking out the master system branch + THEN the system branch master is checked out + +Likewise we can also create new system branches from these, and we +wouldn't need to worry about changing the system branch ref. + + + SCENARIO branch off a system branch with null refs + GIVEN a workspace + AND a git server + AND null refs for local strata + WHEN creating system branch foo + THEN the system branch foo is checked out + +When we edit a morphology with null refs, they stay null. + + SCENARIO editing with null refs + GIVEN a workspace + AND a git server + AND null refs for local strata + +When creating the branch, the refs remain null. + + WHEN creating system branch foo + THEN in branch foo, system test-system refs test-stratum in None + +After editing the stratum they remain null. + + WHEN editing stratum test-stratum in system test-system in branch foo + THEN in branch foo, system test-system refs test-stratum in None + +Refs to chunks are still altered as usual + + WHEN editing chunk test-chunk in test-stratum in test-system in branch foo + THEN in branch foo, system test-system refs test-stratum in None + AND in branch foo, stratum test-stratum refs test-chunk in foo + AND edited chunk test:test-chunk has git branch foo + +Petrifying also leaves null refs unmolested + + SCENARIO morph petrifies null refs + GIVEN a workspace + AND a git server + AND null refs for local strata + WHEN creating system branch foo + AND pushing system branch foo to git server + AND remembering all refs in foo + AND petrifying foo + THEN in branch foo, system test-system refs test-stratum in None diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index cfb744f7..e35e4219 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -114,6 +114,18 @@ another to hold a chunk. repo-alias = test=file://$DATADIR/gits/%s#file://$DATADIR/gits/%s EOF +Morphologies need to support having a null ref, which means look for the +stratum in the same repository and ref. Testing this requires different +morphologies. + + IMPLEMENTS GIVEN null refs for local strata + nullify_local_refs test:morphs master \ + "$DATADIR/gits/morphs/test-system.morph" \ + "$DATADIR/gits/morphs/test-stratum.morph" + run_in "$DATADIR/gits/morphs" git add . + run_in "$DATADIR/gits/morphs" git commit -m "Use null refs." + + Implementation sections for system branch operations ---------------------------------------------------- diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib index 4fb1eb10..448c60ce 100644 --- a/yarns/morph.shell-lib +++ b/yarns/morph.shell-lib @@ -144,6 +144,11 @@ assert_morphologies_are_petrified() } +nullify_local_refs() +{ + "$SRCDIR/scripts/nullify-local-refs" "$@" +} + # Currently, yarn isn't setting $SRCDIR to point at the project source # directory. We simulate this here. |