monotone

monotone Mtn Source Tree

Root/tests/t_disapprove.at

1# -*- Autoconf -*-
2
3AT_SETUP([creating a trusted and untrusted update])
4
5MONOTONE_SETUP
6
7AT_DATA(testfile, [first line of the file
8second line of the file
9third line of the file
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, [first line of the file
17an insertion between first and second
18second line of the file
19third line of the file
20])
21
22AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
23LEFT_GOOD_M_SHA=`SHA1(MT/manifest)`
24LEFT_GOOD_F_SHA=`SHA1(testfile)`
25AT_CHECK(test $LEFT_GOOD_M_SHA != $ROOT_M_SHA)
26AT_CHECK(test $LEFT_GOOD_F_SHA != $ROOT_F_SHA)
27
28AT_DATA(testfile, [first line of the file
29an insertion between first and second
30second line of the file
31third line of the file
32an evil line which should never be seen
33])
34
35AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
36LEFT_BAD_M_SHA=`SHA1(MT/manifest)`
37LEFT_BAD_F_SHA=`SHA1(testfile)`
38AT_CHECK(test $LEFT_BAD_M_SHA != $LEFT_GOOD_M_SHA)
39AT_CHECK(test $LEFT_BAD_F_SHA != $LEFT_GOOD_F_SHA)
40
41PROBE_NODE(testfile, $ROOT_M_SHA, $ROOT_F_SHA)
42
43AT_DATA(testfile, [first line of the file
44second line of the file
45an insertion between second and third
46third line of the file
47])
48
49
50AT_CHECK(MONOTONE disapprove manifest $LEFT_GOOD_M_SHA $LEFT_BAD_M_SHA, [], [ignore], [ignore])
51AT_CHECK(MONOTONE update, [], [ignore], [ignore])
52
53# files should now be merged
54
55AT_DATA(probe, [first line of the file
56an insertion between first and second
57second line of the file
58an insertion between second and third
59third line of the file
60])
61
62AT_CHECK(cmp testfile probe, [], [ignore])
63
64AT_CLEANUP

Archive Download this file

Branches

Tags

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