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 (25 lines) | stat: -rw-r--r-- 773 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
mtn_setup()

-- pivot_root to a directory that hasn't been commited yet should work

mkdir("workspace")
check(indir("workspace", mtn("setup", ".", "-b", "testbranch")),
      0, false, false)

writefile("workspace/file1", "blah blah")
check(indir("workspace", mtn("add", ".")), 0, false, false)

check(indir("workspace", mtn("commit", "-m", "foo")), 0, false, false)

mkdir("workspace/new_root")
check(indir("workspace", mtn("add", "new_root")), 0, false, false)

check(indir("workspace", mtn("pivot_root", "new_root", "Attic")),
      0, false, false)

check(isdir("workspace/_MTN"))
check(isdir("workspace/Attic"))
check(exists("workspace/Attic/file1"))
check(not exists("workspace/new_root"))

check(indir("workspace", mtn("commit", "-m", "pivotted")), 0, false, false)