summaryrefslogtreecommitdiff
path: root/tests.branching
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-29 15:59:02 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-29 18:49:31 +0100
commitce83a0afe0a51c9b8ab75e89d23f45c3ebf2be93 (patch)
tree1cb88b939109007383f4dec3da61e1b66c6d76cc /tests.branching
parent34c03048cc99e8a8abeb3e3c99574a92a2acb00a (diff)
downloadmorph-ce83a0afe0a51c9b8ab75e89d23f45c3ebf2be93.tar.gz
Remember repository that was branched off from for merging and editing
With this commit, "morph branch" and "morph checkout" remember the repository that was branched off from (the "branch root") in a special file called $workspace/$branch/.morph-system-branch/branch-root This information is later used when checking out individual repositories using "morph edit" instead of using the previously hard-coded "$workspace/$branch/morphs" repository as the branch root. This commit also updates the "morph merge" code to handle repositories specified with aliases or as full URLs in the same way "morph checkout" does. All affected tests are updated.
Diffstat (limited to 'tests.branching')
-rw-r--r--tests.branching/branch-creates-new-system-branch-not-from-master.stdout1
-rw-r--r--tests.branching/branch-creates-new-system-branch.stdout1
-rw-r--r--tests.branching/checkout-existing-branch.stdout1
-rw-r--r--tests.branching/checkout-non-aliased-repos.stdout2
-rwxr-xr-xtests.branching/edit-checkouts-existing-chunk.script4
-rwxr-xr-xtests.branching/edit-clones-chunk.script5
-rwxr-xr-xtests.branching/edit-uses-ref-from-stratum.script2
-rwxr-xr-xtests.branching/merge-explicitly-named-repos.script4
-rwxr-xr-xtests.branching/workflow.script4
9 files changed, 15 insertions, 9 deletions
diff --git a/tests.branching/branch-creates-new-system-branch-not-from-master.stdout b/tests.branching/branch-creates-new-system-branch-not-from-master.stdout
index af1ad6cd..7dc55cc0 100644
--- a/tests.branching/branch-creates-new-system-branch-not-from-master.stdout
+++ b/tests.branching/branch-creates-new-system-branch-not-from-master.stdout
@@ -9,6 +9,7 @@ d ./newbranch
d ./newbranch/.morph-system-branch
d ./newbranch/morphs
d ./newbranch/morphs/.git
+f ./newbranch/.morph-system-branch/branch-root
f ./newbranch/morphs/hello-stratum.morph
f ./newbranch/morphs/hello-system.morph
f ./newbranch/morphs/this.is.alfred
diff --git a/tests.branching/branch-creates-new-system-branch.stdout b/tests.branching/branch-creates-new-system-branch.stdout
index e22ef30b..c37fb0e4 100644
--- a/tests.branching/branch-creates-new-system-branch.stdout
+++ b/tests.branching/branch-creates-new-system-branch.stdout
@@ -9,6 +9,7 @@ d ./newbranch
d ./newbranch/.morph-system-branch
d ./newbranch/morphs
d ./newbranch/morphs/.git
+f ./newbranch/.morph-system-branch/branch-root
f ./newbranch/morphs/hello-stratum.morph
f ./newbranch/morphs/hello-system.morph
Current branches:
diff --git a/tests.branching/checkout-existing-branch.stdout b/tests.branching/checkout-existing-branch.stdout
index 7ac4a149..1af2900c 100644
--- a/tests.branching/checkout-existing-branch.stdout
+++ b/tests.branching/checkout-existing-branch.stdout
@@ -9,6 +9,7 @@ d ./master
d ./master/.morph-system-branch
d ./master/baserock:morphs
d ./master/baserock:morphs/.git
+f ./master/.morph-system-branch/branch-root
f ./master/baserock:morphs/hello-stratum.morph
f ./master/baserock:morphs/hello-system.morph
Current branches:
diff --git a/tests.branching/checkout-non-aliased-repos.stdout b/tests.branching/checkout-non-aliased-repos.stdout
index 75dcd63d..872d74aa 100644
--- a/tests.branching/checkout-non-aliased-repos.stdout
+++ b/tests.branching/checkout-non-aliased-repos.stdout
@@ -12,6 +12,7 @@ d ./master/TEMP_DIR
d ./master/DATADIR
d ./master/DATADIR/morphs
d ./master/DATADIR/morphs/.git
+f ./master/.morph-system-branch/branch-root
f ./master/DATADIR/morphs/hello-stratum.morph
f ./master/DATADIR/morphs/hello-system.morph
Current branches of repo with suffix:
@@ -30,6 +31,7 @@ d ./master/TEMP_DIR
d ./master/DATADIR
d ./master/DATADIR/morphs
d ./master/DATADIR/morphs/.git
+f ./master/.morph-system-branch/branch-root
f ./master/DATADIR/morphs/hello-stratum.morph
f ./master/DATADIR/morphs/hello-system.morph
Current branches of repo without suffix:
diff --git a/tests.branching/edit-checkouts-existing-chunk.script b/tests.branching/edit-checkouts-existing-chunk.script
index b8480a5b..1c8e66cd 100755
--- a/tests.branching/edit-checkouts-existing-chunk.script
+++ b/tests.branching/edit-checkouts-existing-chunk.script
@@ -33,7 +33,7 @@ echo "Current branches, morphs:"
"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/alfred/baserock:morphs" branch
echo "Current branches, hello:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/alfred/hello" branch
+"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/alfred/baserock:hello" branch
echo "Files in hello:"
-ls "$DATADIR/workspace/alfred/hello"
+ls "$DATADIR/workspace/alfred/baserock:hello"
diff --git a/tests.branching/edit-clones-chunk.script b/tests.branching/edit-clones-chunk.script
index 20f62a27..d5e117cb 100755
--- a/tests.branching/edit-clones-chunk.script
+++ b/tests.branching/edit-clones-chunk.script
@@ -38,9 +38,10 @@ echo "Current origin, morphs:"
sed 's,\(TMP/workspace/\.morph/cache/gits/file_\).*_,\1,g'
echo "Current branches, hello:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/newbranch/hello" branch
+"$SRCDIR/scripts/run-git-in" \
+ "$DATADIR/workspace/newbranch/baserock:hello" branch
echo "Current origin, hello:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/newbranch/hello" \
+"$SRCDIR/scripts/run-git-in" "$DATADIR/workspace/newbranch/baserock:hello" \
remote show origin | \
sed 's,\(TMP/workspace/\.morph/cache/gits/file_\).*_,\1,g'
diff --git a/tests.branching/edit-uses-ref-from-stratum.script b/tests.branching/edit-uses-ref-from-stratum.script
index ce3e0ccc..f2276f3b 100755
--- a/tests.branching/edit-uses-ref-from-stratum.script
+++ b/tests.branching/edit-uses-ref-from-stratum.script
@@ -29,5 +29,5 @@ cd "$DATADIR/workspace"
cd newbranch/morphs
"$SRCDIR/scripts/test-morph" edit baserock:hello
-cd ../hello
+cd ../baserock:hello
git branch
diff --git a/tests.branching/merge-explicitly-named-repos.script b/tests.branching/merge-explicitly-named-repos.script
index 9052cd31..5a0953a7 100755
--- a/tests.branching/merge-explicitly-named-repos.script
+++ b/tests.branching/merge-explicitly-named-repos.script
@@ -29,7 +29,7 @@ cd "$DATADIR/workspace"
# Make a change to a chunk.
cd newbranch/morphs
"$SRCDIR/scripts/test-morph" edit baserock:hello master
-cd ../hello
+cd ../baserock:hello
touch newfile.txt
git add newfile.txt
git commit -m foo --quiet
@@ -42,7 +42,7 @@ cd otherbranch/morphs
"$SRCDIR/scripts/test-morph" merge newbranch baserock:hello
# Check results.
-cd ../hello
+cd ../baserock:hello
git status --short # make sure all changes are committed
ls newfile.txt # make sure the new file is there
diff --git a/tests.branching/workflow.script b/tests.branching/workflow.script
index 64326e4a..59c7b152 100755
--- a/tests.branching/workflow.script
+++ b/tests.branching/workflow.script
@@ -26,7 +26,7 @@ cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" branch me/readme-fix
cd me/readme-fix/morphs
"$SRCDIR/scripts/test-morph" edit baserock:hello master
-cd ../hello
+cd ../baserock:hello
echo > README yoyoyo
git add README
git commit -m "Fix README, yo!" --quiet
@@ -35,5 +35,5 @@ cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" checkout baserock:morphs master
cd master/baserock:morphs
"$SRCDIR/scripts/test-morph" edit baserock:hello master
-"$SRCDIR/scripts/test-morph" merge me/readme-fix hello
+"$SRCDIR/scripts/test-morph" merge me/readme-fix baserock:hello