File: __driver__.lua

package info (click to toggle)
monotone 0.31-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 20,680 kB
  • ctags: 14,801
  • sloc: cpp: 87,711; ansic: 64,862; sh: 5,691; lisp: 954; perl: 783; makefile: 509; python: 265; sql: 98; sed: 16
file content (28 lines) | stat: -rw-r--r-- 746 bytes parent folder | download
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

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"))
  remove("_MTN")
  check(mtn("checkout", "--revision", rsha[i], "."), 0, true)
  check(sha1("testfile") == fsha[i])
end