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 (47 lines) | stat: -rw-r--r-- 1,739 bytes parent folder | download | duplicates (4)
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

includecommon("netsync.lua")
mtn_setup()
netsync.setup()
revs = {}

addfile("testfile", "blah blah")
commit()
revs.testbranch = base_revision()

writefile("testfile", "stuff stuff")
commit("otherbranch")
revs.otherbranch = base_revision()

writefile("testfile", "nonsense nonsense")
commit("thirdbranch")
revs.thirdbranch = base_revision()

srv = netsync.start()

-- First make sure netsync with explicit server/pattern override defaults
check(mtn2("set", "database", "default-server", "nonsense"), 0, false, false)
check(mtn2("set", "database", "default-include-pattern", "nonsense"), 0, false, false)
srv:pull("testbranch")
check(mtn2("checkout", "--branch=testbranch", "--revision", revs.testbranch,
	   "testdir1"), 0, false, false)
check(exists("testdir1/testfile"))

-- Now make sure explicit server with default pattern works...
check(mtn2("set", "database", "default-server", "nonsense"), 0, false, false)
check(mtn2("set", "database", "default-include-pattern", "otherbranch"), 0, false, false)
check(mtn2("unset", "server-include", srv.url), 0, false, false)
srv:pull()
check(mtn2("checkout", "--branch=otherbranch", "--revision", revs.otherbranch,
	   "testdir2"), 0, false, false)
check(exists("testdir2/testfile"))

-- And finally, make sure that passing nothing at all also works (uses default)
check(mtn2("set", "database", "default-server", srv.url), 0, false, false)
check(mtn2("set", "database", "default-include-pattern", "thirdbranch"), 0, false, false)
check(mtn2("unset", "server-include", srv.url), 0, false, false)
check(mtn2("sync"), 0, false, false)
check(mtn2("checkout", "--branch=thirdbranch", "--revision", revs.thirdbranch,
	   "testdir3"), 0, false, false)
check(exists("testdir3/testfile"))

srv:finish()