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 (64 lines) | stat: -rw-r--r-- 1,305 bytes parent folder | download | duplicates (6)
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
58
59
60
61
62
63
64
-- -*-lua-*-
-- 
-- We are testing annotate on this graph:
-- 
--       a
--      /|\
--     / | \
--    b* c* d*
--    |  |  | 
--    e* e* e*
--    \   \/
--     \   e
--      \ /
--       e
--       |
--       f*
-- 
-- The current annotate code will arbitrarily select one of the marked
-- e-revisions for lines coming from e.
-- 

mtn_setup()

addfile("foo", "first\nfoo\nthird\n")
commit()
rev_a = base_revision()

econtents = "first\nsecond\nthird\n"

writefile("foo", "first\nb\nthird\n")
commit()
writefile("foo", econtents)
commit()
rev_e1 = base_revision()

revert_to(rev_a)
writefile("foo", "first\nc\nthird\n")
commit()
writefile("foo", econtents)
commit()
rev_e2 = base_revision()

revert_to(rev_a)
writefile("foo", "first\nd\nthird\n")
commit()
writefile("foo", econtents)
commit()
rev_e3 = base_revision()

check(mtn("merge"), 0, false, false)
check(mtn("update"), 0, false, false)

writefile("foo", econtents .. "fourth\n")
commit()
rev_f = base_revision()

check(mtn("annotate", "foo", "--revs-only"), 0, true, true)

check(qgrep(rev_a .. ": first", "stdout"))
check(qgrep(rev_e1 .. ": second", "stdout")
      or qgrep(rev_e2 .. ": second", "stdout")
      or qgrep(rev_e3 .. ": second", "stdout"))
check(qgrep(rev_a .. ": third", "stdout"))
check(qgrep(rev_f .. ": fourth", "stdout"))