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"))
|