summaryrefslogtreecommitdiff
path: root/tests.branching
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-09-05 19:46:44 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-09-10 10:59:39 +0000
commit586aacfe5b6c5f9b0d18ffa3fd9fe00f6692fe83 (patch)
tree45a1d26bbc4f330ec0d25ba1de198d1a4600d88d /tests.branching
parentfb2e08f81d96741c05597208fdab196ec0c1b584 (diff)
downloadmorph-586aacfe5b6c5f9b0d18ffa3fd9fe00f6692fe83.tar.gz
Rewrite 'merge' command
'merge' now traverses every system in the branch root (baserock:morphs) and merges any chunk or stratum that was changed with 'morph edit'. It also takes care of updating the refs in the target branch.
Diffstat (limited to 'tests.branching')
-rw-r--r--tests.branching/merge-explicitly-named-repos.stdout1
-rwxr-xr-xtests.branching/merge.script (renamed from tests.branching/merge-explicitly-named-repos.script)27
-rwxr-xr-xtests.branching/workflow.script7
3 files changed, 19 insertions, 16 deletions
diff --git a/tests.branching/merge-explicitly-named-repos.stdout b/tests.branching/merge-explicitly-named-repos.stdout
deleted file mode 100644
index cd2122c4..00000000
--- a/tests.branching/merge-explicitly-named-repos.stdout
+++ /dev/null
@@ -1 +0,0 @@
-newfile.txt
diff --git a/tests.branching/merge-explicitly-named-repos.script b/tests.branching/merge.script
index 7dfd5780..7c433519 100755
--- a/tests.branching/merge-explicitly-named-repos.script
+++ b/tests.branching/merge.script
@@ -14,34 +14,37 @@
# 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 merge" merges explicitly named repositories.
-
+# Check that "morph merge" merges a system branch into master
set -eu
-
# Create system branch.
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" init
-"$SRCDIR/scripts/test-morph" branch baserock:morphs newbranch
+"$SRCDIR/scripts/test-morph" branch baserock:morphs baserock/newbranch
# Make a change to a chunk.
"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello
-cd newbranch/baserock:hello
+cd baserock/newbranch/baserock:hello
touch newfile.txt
git add newfile.txt
git commit -m foo --quiet
-# Merge changes to a new system branch.
+# Commit in morphs repo
+cd ../baserock:morphs
+git commit --all --quiet -m "Update morph refs for baserock/newbranch"
+
+# Merge changes back to master
cd "$DATADIR/workspace"
-"$SRCDIR/scripts/test-morph" branch baserock:morphs otherbranch
-cd otherbranch
-"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello
-"$SRCDIR/scripts/test-morph" merge newbranch baserock:hello
+"$SRCDIR/scripts/test-morph" checkout baserock:morphs master
+cd master
+"$SRCDIR/scripts/test-morph" merge baserock/newbranch
# Check results.
cd baserock:hello
git status --short # make sure all changes are committed
-ls newfile.txt # make sure the new file is there
+[ -e newfile.txt ] # make sure the new file is there
+# Make sure all refs to the merged branch have gone.
+cd ../baserock:morphs
+! grep "\"ref\": \"baserock/newbranch\"" *.morph
diff --git a/tests.branching/workflow.script b/tests.branching/workflow.script
index cb79c3c5..68da4f4a 100755
--- a/tests.branching/workflow.script
+++ b/tests.branching/workflow.script
@@ -30,9 +30,10 @@ echo > README yoyoyo
git add README
git commit -m "Fix README, yo!" --quiet
+cd ../baserock:morphs
+git commit --quiet --all -m "Commit changes for system branch"
+
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" checkout baserock:morphs master
cd master
-"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello
-"$SRCDIR/scripts/test-morph" merge me/readme-fix baserock:hello
-
+"$SRCDIR/scripts/test-morph" merge me/readme-fix