File: __driver__.lua

package info (click to toggle)
monotone 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 20,648 kB
  • sloc: cpp: 86,443; sh: 6,906; perl: 924; makefile: 838; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (66 lines) | stat: -rw-r--r-- 1,972 bytes parent folder | download | duplicates (5)
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
65
66

mtn_setup()

-- patch existing file
-- add new file (with patch)
-- rename existing file
-- rename and patch existing file
-- drop existing file

-- again with --brief

addfile("from", "from")
addfile("from_patched", "from_patched")
addfile("patched", "patched")
addfile("dropped", "dropped")

commit()

addfile("added", "added")

writefile("from_patched", "from_patched \npatched")
writefile("patched", "patched \npatched")

check(mtn("drop", "--bookkeep-only", "dropped"), 0, false, false)

rename("from", "to")
rename("from_patched", "to_patched")

check(mtn("rename", "--bookkeep-only", "from", "to"), 0, false, false)
check(mtn("rename", "--bookkeep-only", "from_patched", "to_patched"), 0, false, false)

check(mtn("status"), 0, true, false)
check(qgrep('^  dropped  dropped', "stdout"))
check(qgrep('^  renamed  from', "stdout"))
check(qgrep('^       to  to', "stdout"))
check(qgrep('^  renamed  from_patched', "stdout"))
check(qgrep('^       to  to_patched', "stdout"))
check(qgrep('^  added    added', "stdout"))
check(qgrep('^  patched  patched', "stdout"))
check(qgrep('^  patched  to_patched', "stdout"))

-- restricted

check(mtn("status", "from", "from_patched"), 0, true, false)
check(not qgrep('^  delete "dropped"', "stdout"))
check(qgrep('^  renamed  from', "stdout"))
check(qgrep('^       to  to', "stdout"))
check(qgrep('^  renamed  from_patched', "stdout"))
check(qgrep('^       to  to_patched', "stdout"))
check(not qgrep('^  add_file  added', "stdout"))
check(not qgrep('^  patched  patched', "stdout"))
check(qgrep('^  patched  to_patched', "stdout"))

-- divergence

check(not qgrep("WILL CREATE DIVERGENCE", "stdout"))
base = base_revision()
addfile("foo", "foo")
commit()
other_tip = base_revision()
check(mtn("status"), 0, true, false)
check(not qgrep("WILL CREATE DIVERGENCE", "stdout"))
remove("dropped")
check(mtn("update", "-r", base), 0, false, false)
check(mtn("status"), 0, true, false)
check(qgrep("WILL CREATE DIVERGENCE", "stdout"))