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 (48 lines) | stat: -rw-r--r-- 1,602 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

mtn_setup()

addfile("testfile", "foo bar")
commit()
old = sha1("testfile")
copy("testfile", "old_testfile")

writefile("testfile", "stuff stuff")
new = sha1("testfile")

check(get("testhook.lua"))

check(mtn("--rcfile=testhook.lua", "diff", "--external"), 0, true, false)
canonicalize("stdout")
canonicalize("old_version")
canonicalize("new_version")
check(qgrep('file_path: testfile', "stdout"))
check(samefile("old_version", "old_testfile"))
check(samefile("new_version", "testfile"))
check(qgrep('diff_args is NIL', "stdout"))
check(qgrep("rev_old: "..old, "stdout"))
check(qgrep("rev_new: "..new, "stdout"))

check(mtn("--rcfile=testhook.lua", "diff", "--external", "--diff-args=-foobar"), 0, true, false)
canonicalize("stdout")
canonicalize("old_version")
canonicalize("new_version")
check(qgrep('file_path: testfile', "stdout"))
check(samefile("old_version", "old_testfile"))
check(samefile("new_version", "testfile"))
check(qgrep('diff_args: -foobar', "stdout"))
check(qgrep("rev_old: "..old, "stdout"))
check(qgrep("rev_new: "..new, "stdout"))

check(mtn("--rcfile=testhook.lua", "diff", "--external", "--diff-args", ""), 0, true, false)
canonicalize("stdout")
canonicalize("old_version")
canonicalize("new_version")
check(qgrep('file_path: testfile', "stdout"))
check(samefile("old_version", "old_testfile"))
check(samefile("new_version", "testfile"))
check(qgrep('^diff_args: $', "stdout"))
check(qgrep("rev_old: "..old, "stdout"))
check(qgrep("rev_new: "..new, "stdout"))

-- Make sure that --diff-args without --external is an error
check(mtn("diff", "--diff-args=foo"), 1, false, false)