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 (42 lines) | stat: -rw-r--r-- 1,647 bytes parent folder | download
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

include("/common/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({"testbranch", "otherbranch", "thirdbranch"})

-- 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)
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.address), 0, false, false)
check(mtn2("set", "database", "default-include-pattern", "thirdbranch"), 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()