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 (37 lines) | stat: -rw-r--r-- 1,889 bytes parent folder | download | duplicates (3)
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
mtn_setup()

rev = "format_version \"1\"\n\nnew_manifest [0000000000000000000000000000000000000004]\n\nold_revision []\n\nadd_dir \"\"\n\nadd_file \"foo\"\n content [5bf1fd927dfb8679496a2e6cf00cbe50c1c87145]\n"

check(mtn("automate", "put_file", "blah"), 0, true, false)
canonicalize("stdout")
file = "5bf1fd927dfb8679496a2e6cf00cbe50c1c87145"
result = readfile("stdout")
check(result == file.."\n")

check(mtn("automate", "put_revision", rev), 0, true, false)
canonicalize("stdout")
rev = "4c2c1d846fa561601254200918fba1fd71e6795d"
result = readfile("stdout")
check(result == rev.."\n")

check(mtn("automate", "cert", rev, "author", "tester@test.net"), 0, true, false)
check(mtn("automate", "cert", rev, "branch", "testbranch"), 0, true, false)
check(mtn("automate", "cert", rev, "changelog", "blah-blah"), 0, true, false)
check(mtn("automate", "cert", rev, "date", "2005-05-21T12:30:51"), 0, true, false)

check(mtn("automate", "heads", "testbranch"), 0, true, false)
canonicalize("stdout")
check(rev.."\n" == readfile("stdout"))

--
-- this should trigger an invariant
-- I'm trying to re-add a file which already exists
--
rev = "format_version \"1\"\n\nnew_manifest [0000000000000000000000000000000000000000]\n\nold_revision [4c2c1d846fa561601254200918fba1fd71e6795d]\n\nadd_file \"foo\"\n content [5bf1fd927dfb8679496a2e6cf00cbe50c1c87145]\n"
check(mtn("automate", "put_revision", rev), 3, false, false)

-- but this should work (tests that we can use put_revision to commit a
-- single-parent revision)
check(mtn("automate", "put_file", ""), 0, false, false)
rev = "format_version \"1\"\n\nnew_manifest [0000000000000000000000000000000000000000]\n\nold_revision [4c2c1d846fa561601254200918fba1fd71e6795d]\n\npatch \"foo\"\n from [5bf1fd927dfb8679496a2e6cf00cbe50c1c87145] to [da39a3ee5e6b4b0d3255bfef95601890afd80709]\n"
check(mtn("automate", "put_revision", rev), 0, false, false)