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,190 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()

srv = netsync.start(2)

check(mtn("genkey", "committer@test.net"), 0, false, false,
       "committer@test.net\ncommitter@test.net\n")

writefile("testfile", "version 0 of test file")
check(mtn("add", "testfile"), 0, false, false)
check(mtn("ci", "-mx", "-k", "committer@test.net"), 0, false, false)

check(mtn("au", "select", "b:testbranch"), 0, true)

srv:push("testbranch", 1)


check(mtn("dropkey", "committer@test.net"), 0, false, false)
check(mtn("genkey", "committer@test.net"), 0, false, false,
       "committer@test.net\ncommitter@test.net\n")

writefile("testfile", "version 1 of test file")
check(mtn("ci", "-mx", "-k", "committer@test.net"), 0, false, false)

srv:push("testbranch", 1, 0)

srv:stop()

check(mtn2("ls", "keys"), 0, true, true)

key_lines = readfile_lines("stdout")
first_line = nil
have_different = false
for _, line in pairs(key_lines) do
   if string.find(line, "committer@test.net") then
      if first_line == nil then
         first_line = line
      elseif first_line ~= line then
         have_different = true
      end
   end
end
check(have_different)

check(qgrep("multiple keys", "stderr"))