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 (55 lines) | stat: -rw-r--r-- 1,003 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
-- -*-lua-*-

mtn_setup()
revs = {}

writefile("foo.A", "a\nident\nd\n")
writefile("foo.B", "a\nident\nb\n")
writefile("foo.C", "c\nident\nx\n")

-- foo.D, the ultimate version, as created by our merge3 hook:
-- a
-- ident
-- b
-- c
-- ident
-- d

check(get("merge.lua"))


copy("foo.A", "foo")
check(mtn("add", "foo"), 0, false, false)
commit()
revs.a = base_revision()
L("revs.a = ", revs.a, "\n")

copy("foo.B", "foo")
commit()
revs.b = base_revision()
L("revs.b = ", revs.b, "\n")

revert_to(revs.a)

copy("foo.C", "foo")
commit()
revs.c = base_revision()
L("revs.c = ", revs.c, "\n")

check(mtn("--rcfile=./merge.lua", "merge"), 0, false, false)
check(mtn("update"), 0, false, false)
revs.d = base_revision()
L("revs.d = ", revs.d, "\n")

--
-- annotate foo should now be
-- REVA: a
-- REVA: ident
-- REVB: b
-- REVC: c
-- REVA: ident
-- REVD: d
--

check(mtn("--debug", "annotate", "--revs-only", "foo"), 0, true, true)
check(greplines("stdout", {revs.a, revs.a, revs.b, revs.c, revs.a, revs.d}))