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 (27 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (6)
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