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
|
mtn_setup()
revs = {}
addfile("foo", "foo")
addfile("bar", "bar")
commit()
revs[1] = base_revision()
mkdir("dir1")
mkdir("dir2")
addfile("dir1/file1", "dir1/file1")
commit()
revs[2] = base_revision()
addfile("dir2/file2", "dir2/file2")
commit()
revs[3] = base_revision()
writefile("foo", "foofoo")
writefile("bar", "barbar")
writefile("dir1/file1", "dir1/file1 asdf")
writefile("dir2/file2", "dir2/file2 asdf")
commit()
revs[4] = base_revision()
writefile("dir1/file1", "dir1/file1 asdf asdf")
commit()
revs[5] = base_revision()
writefile("dir2/file2", "dir2/file2 asdf asdf")
commit()
revs[6] = base_revision()
check(mtn("attr", "set", "dir2/", "myattr", "myval"), 0, false, false)
commit()
revs[7] = base_revision()
for n,x in pairs{[""] = {0,0,0,0,0,0,0},
["."] = {0,0,0,0,0,0,0},
dir1 = {1,0,1,0,0,1,1},
dir2 = {1,1,0,0,1,0,0}} do
if n == "" then
check(mtn("log", "--no-graph"), 0, true)
else
check(mtn("log", "--no-graph", n), 0, true, false)
end
for i,v in pairs(x) do
L("Checking log of '", n, "' for revision ", i, "\n")
check((v == 0) == qgrep("^Revision: "..revs[i], "stdout"), 0, false, false)
end
end
|