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
|
mtn_setup()
writefile("testfile", "version 0 of the file\n")
check(mtn("add", "testfile"), 0, false, false)
commit()
fsha = {}
rsha = {}
for i = 1, 6 do
L(string.format("generating version %i of the file\n", i))
writefile("testfile", string.format("version %i of the file\n", i))
commit()
fsha[i] = sha1("testfile")
rsha[i] = base_revision()
end
for i = 1, 6 do
L(string.format("checking version %i of the file\n", i))
writefile("testfile", string.format("version %i of the file\n", i))
check(mtn("automate", "get_file", fsha[i]), 0, true)
canonicalize("stdout")
check(samefile("stdout", "testfile"))
revert_to(rsha[i])
check(sha1("testfile") == fsha[i])
end
|