monotone

monotone Mtn Source Tree

Root/tests/t_update.at

1# -*- Autoconf -*-
2
3AT_SETUP([creating a fork and updating])
4
5MONOTONE_SETUP
6
7# this test is kinda like fork, only it doesn't commit the right side of
8# the fork; instead, it updates, and (in theory) shifts from right to
9# merged-with-left
10
11AT_DATA(testfile, [first line of the file
12second line of the file
13third line of the file
14])
15AT_CHECK(MONOTONE add testfile, [], [ignore], [ignore])
16AT_CHECK(MONOTONE --branch=testbranch commit blah-blah, [], [ignore], [ignore])
17ROOT_M_SHA=`SHA1(MT/manifest)`
18ROOT_F_SHA=`SHA1(testfile)`
19
20AT_DATA(testfile, [first line of the file
21an insertion between first and second
22second line of the file
23third line of the file
24])
25
26AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
27LEFT_M_SHA=`SHA1(MT/manifest)`
28LEFT_F_SHA=`SHA1(testfile)`
29AT_CHECK(test $LEFT_M_SHA != $ROOT_M_SHA)
30AT_CHECK(test $LEFT_F_SHA != $ROOT_F_SHA)
31
32PROBE_NODE(testfile, $ROOT_M_SHA, $ROOT_F_SHA)
33
34AT_DATA(testfile, [first line of the file
35second line of the file
36an insertion between second and third
37third line of the file
38])
39
40AT_CHECK(MONOTONE update, [], [ignore], [ignore])
41
42# files should now be merged
43
44AT_DATA(probe, [first line of the file
45an insertion between first and second
46second line of the file
47an insertion between second and third
48third line of the file
49])
50
51AT_CHECK(cmp testfile probe, [], [ignore])
52
53AT_CLEANUP

Archive Download this file

Branches

Tags

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