monotone

monotone Mtn Source Tree

Root/tests/t_merge.at

1# -*- Autoconf -*-
2
3AT_SETUP([creating a fork and merging])
4
5MONOTONE_SETUP
6
7# this test is kinda like update, only it *does* commit the left right
8# branch before attempting a merge. it just checks to make sure merging
9# works in the context of the "merge" command, not just the "update"
10# command.
11
12AT_DATA(testfile, [first line of the file
13second line of the file
14third line of the file
15])
16AT_CHECK(MONOTONE add testfile, [], [ignore], [ignore])
17AT_CHECK(MONOTONE --branch=testbranch commit blah-blah, [], [ignore], [ignore])
18ROOT_M_SHA=`SHA1(MT/manifest)`
19ROOT_F_SHA=`SHA1(testfile)`
20
21AT_DATA(testfile, [first line of the file
22an insertion between first and second
23second line of the file
24third line of the file
25])
26
27AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
28LEFT_M_SHA=`SHA1(MT/manifest)`
29LEFT_F_SHA=`SHA1(testfile)`
30AT_CHECK(test $LEFT_M_SHA != $ROOT_M_SHA)
31AT_CHECK(test $LEFT_F_SHA != $ROOT_F_SHA)
32
33PROBE_NODE(testfile, $ROOT_M_SHA, $ROOT_F_SHA)
34
35AT_DATA(testfile, [first line of the file
36second line of the file
37an insertion between second and third
38third line of the file
39])
40AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
41RIGHT_M_SHA=`SHA1(MT/manifest)`
42RIGHT_F_SHA=`SHA1(testfile)`
43AT_CHECK(test $RIGHT_M_SHA != $ROOT_M_SHA)
44AT_CHECK(test $RIGHT_F_SHA != $ROOT_F_SHA)
45AT_CHECK(test $RIGHT_M_SHA != $LEFT_M_SHA)
46AT_CHECK(test $RIGHT_F_SHA != $LEFT_F_SHA)
47
48# now merge and update again, this time successfully
49AT_CHECK(MONOTONE --branch=testbranch merge, [], [ignore], [ignore])
50AT_CHECK(MONOTONE update, [], [ignore], [ignore])
51
52AT_CHECK(MONOTONE --branch=testbranch heads, [], [stdout], [ignore])
53AT_CHECK(grep empty stdout, [1], [ignore])
54
55# files should now be merged
56AT_DATA(probe, [first line of the file
57an insertion between first and second
58second line of the file
59an insertion between second and third
60third line of the file
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