File: __driver__.lua

package info (click to toggle)
monotone 1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 20,708 kB
  • sloc: cpp: 84,765; sh: 6,787; perl: 837; makefile: 833; python: 517; lisp: 379; sql: 118; exp: 88; ansic: 52
file content (48 lines) | stat: -rw-r--r-- 1,612 bytes parent folder | download | duplicates (5)
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, false, true)
canonicalize("stderr")
canonicalize("old_version")
canonicalize("new_version")
check(qgrep('file_path: testfile', "stderr"))
check(samefile("old_version", "old_testfile"))
check(samefile("new_version", "testfile"))
check(qgrep('diff_args is NIL', "stderr"))
check(qgrep("rev_old: "..old, "stderr"))
check(qgrep("rev_new: "..new, "stderr"))

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

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

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