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 (22 lines) | stat: -rw-r--r-- 823 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
includecommon("netsync.lua")
mtn_setup()
netsync.setup()

-- If we already have epochs for branches we don't have any revisions for,
-- we might get sent those epochs. Make sure that our already having them
-- doesn't prevent us from noting that we received them.

addfile("foo", "foo")
commit()
check(mtn("db", "set_epoch", "testbranch", string.rep("1234567890", 4)))
check(mtn2("db", "set_epoch", "testbranch", string.rep("1234567890", 4)))

-- If we completely ignore the epoch (because we already have it), we'll
-- never notice that refinement is done.
srv = netsync.start()
cli = bg(mtn2("--rcfile=netsync.lua", "sy", srv.address, "testbranch"), 0, false, false)
check(cli:wait(20)) -- give it 20 seconds.
srv:stop()

check(mtn("ls", "branches"), 0, true, false)
check(qgrep("testbranch", "stdout"), 0, false, false)