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 (60 lines) | stat: -rw-r--r-- 1,892 bytes parent folder | download | duplicates (2)
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
59
60

mtn_setup()

remove("_MTN/log")

----------------------
--first, verify that --message-file actually works
----------------------

addfile("input.txt", "version 0 of the file")

writefile("msgfile.txt", "this commit uses the --message-file option")

check(mtn("--branch=testbranch", "commit", "--message-file=msgfile.txt"), 0, false, false)

tsha = base_revision()
check(mtn("ls", "certs", tsha), 0, true, false)
check(qgrep('this commit uses the --message-file option', "stdout"))

----------------------
--also with a file coming outside the workspace
----------------------
check(mtn("setup", "--branch=testbranch", "alt_wrk"), 0, false, false)

writefile("alt_wrk/input1.txt", "files... files...")

writefile("message-out-of-copy.txt", "out out out ")

check(indir("alt_wrk", mtn("add", "input1.txt")), 0, false, false)

check(indir("alt_wrk", mtn("--branch=outbranch", "commit", "--message-file=../message-out-of-copy.txt")), 0, false, false)

tsha = indir("alt_wrk", {base_revision})[1]()
check(indir("alt_wrk", mtn("ls", "certs", tsha)), 0, true, false)
check(qgrep('out out out', "stdout"))

----------------------
--start with the failures: non existing file
----------------------
addfile("input2.txt", "another file")

check(mtn("--branch=testbranch", "commit", "--message-file=to-be-or-not-to-be.txt"), 1, false, false)

----------------------
--then verify that --message and --message-file together cause an error
----------------------

check(mtn("--branch=testbranch", "commit", "--message-file=msgfile.txt",
          "--message=also a message"), 1, false, false)

-- --------------------
-- finally, --message-file and a filled _MTN/log should also fail
-- --------------------

check(get("commit_log.lua"))

writefile("_MTN/log", "Log entry")

check(mtn("--branch=testbranch", "--rcfile=commit_log.lua", "commit",
          "--message-file=msgfile.txt"), 1, false, false)