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 (43 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download | duplicates (6)
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
-- test that 'automate put_revision' works for merge revisions
mtn_setup()

addfile("foo", "blah blah parent")
commit()
f_parent = sha1("foo")
r_parent = base_revision()

writefile("foo", "blah blah left")
commit()
f_left = sha1("foo")
r_left = base_revision()

revert_to(r_parent)

writefile("foo", "blah blah right")
commit()
f_right = sha1("foo")
r_right = base_revision()

writefile("foo-merge", "blah blah merge")
f_merge = sha1("foo-merge")

-- intentionally somewhat idiosyncratic whitespace...
revision_text = ("format_version \"1\"\n"
                 .. "new_manifest [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]\n"
                 .. "old_revision [" .. r_left .. "]\n"
                 .. "patch \"foo\" from [" .. f_left .. "] \n"
                 .. "to [" .. f_merge .. "]\n"
                 .. "\n"
                 .. "old_revision [" .. r_right .. "]\n"
                 .. "patch \"foo\" from [" .. f_right .. "] \n"
                 .. "to [" .. f_merge .. "]\n"
                 .. "\n"
                 .. "\n\n\n" -- just for fun
              )
check(mtn("automate", "put_file", readfile("foo-merge")), 0, false, false)
check(mtn("automate", "put_revision", revision_text), 0, true, false)
r_merge = trim(readfile("stdout"))

check(mtn("update", "-r", r_merge, "-b", "asdf"), 0, false, false)
check(base_revision() == r_merge)
check(samefile("foo", "foo-merge"))