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 (35 lines) | stat: -rw-r--r-- 828 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

includecommon("automate_stdio.lua")

mtn_setup()
revs = {}

addfile("foo", "blah")
commit()
revs.base = base_revision()

for i = 1,4 do
  revert_to(revs.base)
  addfile(tostring(i), tostring(i))
  commit()
  revs[i] = base_revision()
end
table.sort(revs)
for _,x in ipairs(revs) do append("wanted_heads", x.."\n") end
canonicalize("wanted_heads")


check(mtn("automate", "heads", "testbranch"), 0, true, false)
canonicalize("stdout")
check(samefile("wanted_heads", "stdout"))

check(mtn("automate", "heads", "nosuchbranch"), 0, true, false)
writefile("empty")
check(samefile("empty", "stdout"))

-- In mtn 0.40 and earlier, this was broken, because automate stdio
-- did not re-read the workspace options for each command, so the
-- branch was null.
check(run_stdio("l5:headse", 0) == readfile("wanted_heads"))

-- end of file