monotone

monotone Mtn Source Tree

Root/tests/t_fork.at

1# -*- Autoconf -*-
2
3AT_SETUP([creating a fork])
4
5MONOTONE_SETUP
6
7
8AT_DATA(testfile, [version 0 of test file
9])
10
11AT_CHECK(MONOTONE add testfile, [], [ignore], [ignore])
12AT_CHECK(MONOTONE --branch=testbranch commit blah-blah, [], [ignore], [ignore])
13ROOT_M_SHA=`SHA1(MT/manifest)`
14ROOT_F_SHA=`SHA1(testfile)`
15
16AT_DATA(testfile, [left version of fork
17])
18AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
19LEFT_M_SHA=`SHA1(MT/manifest)`
20LEFT_F_SHA=`SHA1(testfile)`
21AT_CHECK(test $LEFT_M_SHA != $ROOT_M_SHA)
22AT_CHECK(test $LEFT_F_SHA != $ROOT_F_SHA)
23
24AT_CHECK(MONOTONE --branch=testbranch heads, [], [stdout], [ignore])
25AT_CHECK(grep empty stdout, [1], [ignore])
26
27PROBE_NODE(testfile, $ROOT_M_SHA, $ROOT_F_SHA)
28
29AT_DATA(testfile, [right version of fork
30])
31AT_CHECK(MONOTONE add testfile, [], [ignore], [ignore])
32AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
33RIGHT_M_SHA=`SHA1(MT/manifest)`
34RIGHT_F_SHA=`SHA1(testfile)`
35AT_CHECK(test $RIGHT_M_SHA != $ROOT_M_SHA)
36AT_CHECK(test $RIGHT_F_SHA != $ROOT_F_SHA)
37AT_CHECK(test $RIGHT_M_SHA != $LEFT_M_SHA)
38AT_CHECK(test $RIGHT_F_SHA != $LEFT_F_SHA)
39
40# fork committed ok. now check to make sure
41# all 3 nodes are reconstructable
42
43PROBE_NODE(testfile, $ROOT_M_SHA, $ROOT_F_SHA)
44PROBE_NODE(testfile, $LEFT_M_SHA, $LEFT_F_SHA)
45PROBE_NODE(testfile, $RIGHT_M_SHA, $RIGHT_F_SHA)
46
47AT_CLEANUP

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status