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

check(getstd("test_keys"))
check(getstd("test_hooks.lua"))
check(getstd("min_hooks.lua"))
check(get("rcfile.lua"))

-- create a new database initially
check(nodb_mtn("setup", "--rcfile", "rcfile.lua", "--branch=test1", "test1"), 0, false, true)
check(qgrep("initializing new database", "stderr"))
check(indir("test1", mtn("au", "get_option", "database")), 0, true, false)
rename("stdout", "test1_db")

check(exists("managed_databases/default.mtn"))
check(fsize("managed_databases/default.mtn") > 0)

-- but re-use it if it already exists
check(nodb_mtn("setup", "--rcfile", "rcfile.lua", "--branch=test2", "test2"), 0, false, true)
check(not qgrep("initializing new database", "stderr"))
check(indir("test2", mtn("au", "get_option", "database")), 0, true, false)
rename("stdout", "test2_db")

-- if everything goes well, both workspaces should have the same 
-- database and both should be registered
check(samefile("test1_db", "test2_db"))
check(nodb_mtn("ls", "dbs", "--rcfile", "rcfile.lua"), 0, true, false)
check(qgrep("test1", "stdout"))
check(qgrep("test2", "stdout"))