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 (33 lines) | stat: -rw-r--r-- 1,139 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

mtn_setup()

writefile("foo", "some data")
-- Check a single character filename too, because those have had bugs.
writefile("a", "some data")

check(mtn("add", "foo"), 0, false, false)
check(mtn("add", "a"), 0, false, false)
check(mtn("attr", "set", "foo", "test:test_attr", "true"), 0, false, false)
check(mtn("attr", "set", "a", "test:test_attr", "1"), 0, false, false)
commit()
co_r_sha1 = base_revision()

check(mtn("attr", "drop", "foo", "test:test_attr"), 0, false, false)
check(mtn("attr", "set", "a", "test:test_attr", "2"), 0, false, false)
commit()
update_r_sha1 = base_revision()

-- Check checkouts.
remove("co-dir")
check(mtn("checkout", "--revision", co_r_sha1, "co-dir"), 0, false, true)
check(qgrep("test:test_attr:foo:true", "stderr"))
check(qgrep("test:test_attr:a:1", "stderr"))

-- Check updates.
remove("co-dir")
check(mtn("checkout", "--revision", update_r_sha1, "co-dir"), 0, false, true)
check(not qgrep("test:test_attr:foo", "stderr"))
check(qgrep("test:test_attr:a:2", "stderr"))

-- check that files must exist to have attributes set
check(mtn("attr", "set", "missing", "mtn:execute", "true"), 1, false, false)