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 (44 lines) | stat: -rw-r--r-- 1,049 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
43
44

include("common/netsync.lua")
mtn_setup()
netsync.setup()
rseed = os.time()

addfile("testfile", "foo")
commit()
t1 = base_revision()

-- set defaults in db 2
math.randomseed(rseed)
netsync.pull("testbranch")
check(mtn2("automate", "get_revision", t1), 0, false, false)

writefile("testfile", "blah blah")
commit()
t2 = base_revision()

-- make sure the defaults really were set to 'testbranch'
math.randomseed(rseed)
srv = netsync.start("testbranch")
check(mtn2("pull"), 0, false, false)
srv:stop()
check(mtn2("automate", "get_revision", t2), 0, false, false)

-- do a --set-default pull of another branch
math.randomseed(rseed)
srv = netsync.start("otherbranch")
srv:pull({"otherbranch", "--set-default"})
srv:stop()

-- create a new revision on that branch
writefile("testfile", "other1")
commit("otherbranch")
o1 = base_revision()

-- and make sure that our default is now it
math.randomseed(rseed)
srv = netsync.start("otherbranch")
check(mtn2("pull"), 0, false, false)
srv:stop()

check(mtn2("automate", "get_revision", o1), 0, false, false)