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 (32 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download | duplicates (7)
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
-- -*-lua-*-
mtn_setup()

-- automate branches on empty db should return successful and empty
check(mtn("automate", "branches"), 0, true, true)
check(fsize("stdout") == 0)
check(fsize("stderr") == 0)

-- Let's create some branches, so we have stuff to list
writefile("foo.testbranch", "this is the testbranch version")
writefile("foo.otherbranch", "this version goes in otherbranch")

copy("foo.testbranch", "foo")
check(mtn("add", "foo"), 0, false, false)
commit()

copy("foo.otherbranch", "foo")
commit("otherbranch")

-- automate branches should list 2 branches now
check(mtn("automate", "branches"), 0, true, true)
check(samelines("stdout", {"otherbranch", "testbranch"}))

-- Create an ignore_branch hook to pass in
check(get("ignore_branch.lua"))

-- if we make a change in the branch.to.be.ignored it should not turn up in the list
copy("foo.testbranch", "in_ignored")
check(mtn("--rcfile=ignore_branch.lua", "add", "in_ignored"), 0, false, false)
commit("branch.to.be.ignored")
check(mtn("--rcfile=ignore_branch.lua", "automate", "branches"),0,true,true)
check(samelines("stdout", {"otherbranch", "testbranch"}))