File: __driver__.lua

package info (click to toggle)
monotone 0.31-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 20,680 kB
  • ctags: 14,801
  • sloc: cpp: 87,711; ansic: 64,862; sh: 5,691; lisp: 954; perl: 783; makefile: 509; python: 265; sql: 98; sed: 16
file content (57 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
mtn_setup()

--    root               - contains a, b, c
--     |  \
--     |   \
--     |    two_rev      - drop c, add d
--     |          |
--     one_rev    |      - edit a
--     |    \     |
--     |     \    |
--     |      \   |
--     |       merge 1
--     |
--     pluck_rev         - edit b
--
-- In a workspace at merge 1, we want to pluck the edit of b from pluck_rev.

-- set up root
addfile("a", "original\n")
addfile("b", "original\n")
addfile("c", "original\n")
commit()
root_rev = base_revision()

-- and one_rev
writefile("a", "updated\n")
commit()
one_rev = base_revision()

-- and pluck_rev
writefile("b", "updated\n")
commit()
pluck_rev = base_revision()

-- and two_rev
revert_to(root_rev)
addfile("d", "original\n")
check(mtn("drop", "-e", "c"), 0, false, false)
commit()
two_rev = base_revision()

-- and merge 1
check(mtn("explicit_merge", one_rev, two_rev, "testbranch"), 0, false, false)
check(mtn("update"), 0, false, false)

-- check that we need the edit for b
check(readfile("b") == "original\n", 0, false, false)
-- pluck the edit
check(mtn("pluck", "-r", pluck_rev), 0, false, false)
-- check that we go it
check(readfile("b") == "updated\n", 0, false, false)

-- check the pending rev; we don't expect to see changes from two_rev
check(mtn("automate", "get_revision"), 0, true, false)
check(not qgrep("delete", "stdout"))
check(not qgrep("add_file", "stdout"))