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 (28 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (4)
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()

check(get("commit_cancelled.lua"))
check(get("commit_confirmed.lua"))

writefile("_MTN/log", "Log Entry")
writefile("input.txt", "version 0 of the file")

check(mtn("add", "input.txt"), 0, false, false)

-- this should now fail, given that the log file has content and the cancel line
-- has been removed
check(mtn("--branch=testbranch", "--rcfile=commit_cancelled.lua", "commit"), 1, false, true)
check(qgrep('commit cancelled.', "stderr"))

check(exists("_MTN/log"))
check(fsize("_MTN/log") > 0)

-- this should pass, as the lua hook now returns a string that still includes the
-- cancel line
check(mtn("--branch=testbranch", "--rcfile=commit_confirmed.lua", "commit"), 0, false, false)

tsha = base_revision()
check(exists("_MTN/log"))
check(fsize("_MTN/log") == 0)
check(mtn("ls", "certs", tsha), 0, true, false)
check(qgrep("Log Entry", "stdout"))