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

mtn_setup()

mkdir("foo")
writefile("file1", "x")
writefile("foo/bar", "y")

check(mtn("add", "file1"), 0, false, false)
check(mtn("add", "foo/bar"), 0, false, false)

check(mtn("ci", "--exclude", ".", "-m", 'x'), 1, false, false)

-- this is dumb. excluding the whole tree and including file1 is
-- equivalent to just including file1. except that at this point 
-- the root dir has not been created and excluding the whole tree
-- excludes this creation. this causes the commit to fail because
-- file1 has no parent.

-- implicitly including all parents of explicitly included nodes
-- fixes this problem but will include changes to the parent nodes

-- explicit exclude and implicit include of "."

check(mtn("ci", "--exclude", ".", "file1", "-m", "x"), 0, false, false)
check(mtn("status"), 0, true, false)
check(qgrep("foo/bar", "stdout"))
check(not qgrep("file1", "stdout"))
append("file1", "a")

check(mtn("ci", "--exclude", "foo", "-m", 'x'), 0, false, false)
check(mtn("status"), 0, true)
check(qgrep("foo/bar", "stdout"))
check(not qgrep("file1", "stdout"))
append("file1", "a")

check(mtn("ci", ".", "--exclude", "file1", "-m", 'x'), 0, false, false)
check(mtn("status"), 0, true)
check(not qgrep("foo/bar", "stdout"))
check(qgrep("file1", "stdout"))
append("foo/bar", "b")

-- explicit exclude and implicit include of foo

check(mtn("ci", ".", "--exclude", "foo", "foo/bar", "-m", 'x'), 0, false, false)
check(mtn("status"), 0, true)
check(not qgrep("foo/bar", "stdout"))
check(not qgrep("file1", "stdout"))
append("file1", "a")
append("foo/bar", "b")

check(mtn("ci", "--exclude", "foo", "foo/bar", "-m", 'x'), 0, false, false)
check(mtn("status"), 0, true)
check(not qgrep("foo/bar", "stdout"))
check(qgrep("file1", "stdout"))