File: __driver__.lua

package info (click to toggle)
monotone 1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,984 kB
  • ctags: 8,622
  • sloc: cpp: 86,450; sh: 6,906; perl: 924; makefile: 813; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (42 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (7)
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

mtn_setup()

-- this test is kinda like update, only it *does* commit the left right
-- branch before attempting a merge. it just checks to make sure merging
-- works in the context of the "merge" command, not just the "update"
-- command.

check(get("origfile", "testfile"))
addfile("testfile")
commit()
root_r_sha = base_revision()
root_f_sha = sha1("testfile")

check(get("firstinsert", "testfile"))
commit()
left_r_sha = base_revision()
left_f_sha = sha1("testfile")
check(left_r_sha ~= root_r_sha)
check(left_f_sha ~= root_f_sha)

probe_node("testfile", root_r_sha, root_f_sha)

check(get("secondinsert", "testfile"))
commit()
right_r_sha = base_revision()
right_f_sha = sha1("testfile")
check(right_r_sha ~= root_r_sha)
check(right_f_sha ~= root_f_sha)
check(right_r_sha ~= left_r_sha)
check(right_f_sha ~= left_f_sha)

-- now merge and update again, this time successfully
check(mtn("--branch=testbranch", "merge"), 0, false, false)
check(mtn("update"), 0, false, false)

check(mtn("--branch=testbranch", "heads"), 0, true, false)
check(not qgrep("empty", "stdout"))

-- files should now be merged
check(get("bothinsert", "probe"))
check(samefile("testfile", "probe"))