summaryrefslogtreecommitdiff
path: root/tests.branching
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-10-11 17:26:17 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-10-11 17:26:17 +0000
commite3aa8ba25847397a03a665492a0cbe4541814246 (patch)
tree8d422fec634a308a34cb953bad3874242ae8671f /tests.branching
parent871f8ea000d68463b0b0c68bcb3647975154334e (diff)
parenta3e9b6e86b636f67834bc38af906db9272a16b1b (diff)
downloadmorph-e3aa8ba25847397a03a665492a0cbe4541814246.tar.gz
Merge remote-tracking branch 'origin/samthursfield/S4873-warn-when-merge-causes-petrification'
Renamed petrification test slightly as merge fixup.
Diffstat (limited to 'tests.branching')
-rwxr-xr-xtests.branching/merge-handles-unmergable-cases.script2
-rw-r--r--tests.branching/merge-handles-unmergable-cases.stderr2
-rwxr-xr-xtests.branching/merge-warns-if-merging-petrified-morphologies.script32
-rw-r--r--tests.branching/merge-warns-if-merging-petrified-morphologies.stdout1
4 files changed, 36 insertions, 1 deletions
diff --git a/tests.branching/merge-handles-unmergable-cases.script b/tests.branching/merge-handles-unmergable-cases.script
index fd7f1478..e1ba5f9e 100755
--- a/tests.branching/merge-handles-unmergable-cases.script
+++ b/tests.branching/merge-handles-unmergable-cases.script
@@ -24,7 +24,9 @@ cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" branch baserock:morphs test/unmergable
cd "$DATADIR/workspace/test/unmergable/baserock:morphs"
+"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum
sed -ie 's/"kind": "stratum"/"kind": "chunk"/' hello-stratum.morph
git commit --quiet --all -m "Unmergeable because kind has changed"
+
cd "$DATADIR/workspace/master/baserock:morphs"
"$SRCDIR/scripts/test-morph" merge test/unmergable
diff --git a/tests.branching/merge-handles-unmergable-cases.stderr b/tests.branching/merge-handles-unmergable-cases.stderr
index 64c9c34b..ff6539a7 100644
--- a/tests.branching/merge-handles-unmergable-cases.stderr
+++ b/tests.branching/merge-handles-unmergable-cases.stderr
@@ -1 +1 @@
-ERROR: merge conflict: "kind" of morphology hello-stratum changed from chunk to stratum
+ERROR: merge conflict: "kind" of morphology hello-system.hello-stratum changed from stratum to chunk
diff --git a/tests.branching/merge-warns-if-merging-petrified-morphologies.script b/tests.branching/merge-warns-if-merging-petrified-morphologies.script
new file mode 100755
index 00000000..12e726ed
--- /dev/null
+++ b/tests.branching/merge-warns-if-merging-petrified-morphologies.script
@@ -0,0 +1,32 @@
+#!/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.
+
+# If the user merges a petrified branch into an unpetrified branch,
+# we should warn them.
+
+set -eu
+
+cd "$DATADIR/workspace"
+"$SRCDIR/scripts/test-morph" init
+"$SRCDIR/scripts/test-morph" checkout baserock:morphs master
+"$SRCDIR/scripts/test-morph" branch baserock:morphs test/petrified
+
+cd "$DATADIR/workspace/test/petrified/baserock:morphs"
+"$SRCDIR/scripts/test-morph" petrify
+git commit --quiet --all -m "Petrify branch"
+
+cd "$DATADIR/workspace/master/baserock:morphs"
+"$SRCDIR/scripts/test-morph" merge test/petrified
diff --git a/tests.branching/merge-warns-if-merging-petrified-morphologies.stdout b/tests.branching/merge-warns-if-merging-petrified-morphologies.stdout
new file mode 100644
index 00000000..65985486
--- /dev/null
+++ b/tests.branching/merge-warns-if-merging-petrified-morphologies.stdout
@@ -0,0 +1 @@
+WARNING: chunk "hello-system.hello-stratum.hello" is now petrified