monotone

monotone Mtn Source Tree

Root/tests/t_erename.at

1# -*- Autoconf -*-
2
3AT_SETUP([renaming and editing a file])
4
5MONOTONE_SETUP
6
7AT_DATA(foo1, [foo file 1
8])
9AT_DATA(foo2, [foo file 2
10])
11AT_DATA(bar1, [bar file 1
12])
13AT_DATA(bar2, [bar file 2
14])
15AT_DATA(bleh, [bleh file
16])
17
18# produce root
19AT_CHECK(cp foo1 foo)
20AT_CHECK(MONOTONE add foo, [], [ignore], [ignore])
21AT_CHECK(MONOTONE --branch=testbranch commit root, [], [ignore], [ignore])
22ROOT_M_SHA=`SHA1(MT/manifest)`
23ROOT_F_SHA=`SHA1(foo)`
24
25# produce 4-step path with move in the middle
26AT_CHECK(cp foo2 foo)
27AT_CHECK(MONOTONE commit edit-foo, [], [ignore], [ignore])
28AT_CHECK(MONOTONE rename foo bar, [], [ignore], [ignore])
29AT_CHECK(cp bar1 bar)
30AT_CHECK(MONOTONE commit rename-to-bar, [], [ignore], [ignore])
31AT_CHECK(cp bar2 bar)
32AT_CHECK(MONOTONE commit edit-bar, [], [ignore], [ignore])
33
34# revert to root
35PROBE_NODE(foo, $ROOT_M_SHA, $ROOT_F_SHA)
36AT_CHECK(rm bar)
37
38# make a simple add edge
39AT_CHECK(MONOTONE add bleh, [], [ignore], [ignore])
40AT_CHECK(MONOTONE commit blah-blah, [], [ignore], [ignore])
41
42# merge the add and the rename
43AT_CHECK(MONOTONE merge, [], [ignore], [ignore])
44AT_CHECK(MONOTONE update, [], [ignore], [ignore])
45AT_CHECK(grep bar MT/manifest, [0], [ignore], [ignore])
46AT_CHECK(grep bleh MT/manifest, [0], [ignore], [ignore])
47AT_CHECK(grep foo MT/manifest, [1], [ignore], [ignore])
48
49# now the moment of truth: do we *think* there was a rename?
50AT_CHECK(MONOTONE diff $ROOT_M_SHA, [], [stdout], [ignore])
51AT_CHECK(grep move stdout, [0], [ignore], [ignore])
52
53AT_CHECK(rm bar)
54
55AT_CLEANUP
56
57

Archive Download this file

Branches

Tags

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