monotone

monotone Commit Details

Date:2007-03-12 05:40:57 (12 years 3 months ago)
Author:Derek Scherger
Branch:net.venge.monotone.experiment.commands-with-dashes
Commit:254f044f6d3af26f8370fef8cde16a1dddd37eed
Parents: 8d0f0258404020d0f464d2888dcf7ab66dcd9d09
Message: * replace underscores with dashes in the tests

Changes:
Mtests/_MTN_case-folding_security_patch/__driver__.lua (1 diff)
Mtests/a_tricky_cvs_repository_with_tags/__driver__.lua (1 diff)
Mtests/common/automate_ancestry.lua (1 diff)
Mtests/cvs_import,_deleted_file_invariant/__driver__.lua (1 diff)
Mtests/cvs_import,_file_dead_on_head_and_branch/__driver__.lua (1 diff)
Mtests/cvs_import_with_file_added_on_a_branch/__driver__.lua (1 diff)
Mtests/db_data_format_checking/__driver__.lua (1 diff)
Mtests/db_kill_branch_certs_locally_command/__driver__.lua (2 diffs)
Mtests/db_kill_rev_and_recommit/__driver__.lua (1 diff)
Mtests/db_kill_rev_locally_command/__driver__.lua (2 diffs)
Mtests/db_kill_rev_locally_command_2/__driver__.lua (1 diff)
Mtests/db_kill_tag_locally/__driver__.lua (2 diffs)
Mtests/explicit_merge/__driver__.lua (1 diff)
Mtests/explicit_merge_LEFT_RIGHT_ANC_BRANCH/__driver__.lua (1 diff)
Mtests/importing_a_cvs_file_with_one_version/__driver__.lua (1 diff)
Mtests/importing_a_small,_real_cvs_repository/__driver__.lua (1 diff)
Mtests/importing_cvs_branches_with_correct_ancestory/__driver__.lua (1 diff)
Mtests/importing_cvs_files/__driver__.lua (1 diff)
Mtests/importing_cvs_files_with_identical_logs/__driver__.lua (1 diff)
Mtests/importing_cvs_with_vendor_imports_and_branches/__driver__.lua (1 diff)
Mtests/inodeprints/__driver__.lua (1 diff)
Mtests/ls_epochs/__driver__.lua (1 diff)
Mtests/merge_a_project_into_a_subdirectory_of_an_unrelated_project/__driver__.lua (1 diff)
Mtests/merge_conflict_with_no_lca/__driver__.lua (1 diff)
Mtests/merge_into_workspace/__driver__.lua (2 diffs)
Mtests/merge_into_workspace_attr_corpse/__driver__.lua (2 diffs)
Mtests/merge_into_workspace_files_added/__driver__.lua (1 diff)
Mtests/merge_into_workspace_no_changes/__driver__.lua (2 diffs)
Mtests/merge_into_workspace_same_rev/__driver__.lua (1 diff)
Mtests/merge_rev_with_ancestor/__driver__.lua (1 diff)
Mtests/migrate_workspace/__driver__.lua (2 diffs)
Mtests/netsync_client_absorbs_and_checks_epochs/__driver__.lua (1 diff)
Mtests/netsync_epoch_refinement/__driver__.lua (1 diff)
Mtests/netsync_hook_errcodes/__driver__.lua (1 diff)
Mtests/netsync_server_absorbs_and_checks_epochs/__driver__.lua (1 diff)
Mtests/one-way_netsync_where_the_sink_has_more_epochs/__driver__.lua (1 diff)
Mtests/pivot_root/__driver__.lua (1 diff)
Mtests/pivot_root_to_new_dir/__driver__.lua (2 diffs)
Mtests/pluck_lifecycle/__driver__.lua (1 diff)
Mtests/refresh_inodeprints/__driver__.lua (1 diff)
Mtests/restricted_commit_with_inodeprints/__driver__.lua (2 diffs)
Mtests/reverting_a_pivot_root/__driver__.lua (1 diff)
Mtests/schema_migration/__driver__.lua (1 diff)
Mtests/schema_migration_error_recovery/__driver__.lua (1 diff)
Mtests/show_conflicts/__driver__.lua (1 diff)
Mtests/ssh_agent/__driver__.lua (6 diffs)
Mtests/test_a_merge_7/__driver__.lua (1 diff)
Mtests/test_problematic_cvs_import/__driver__.lua (1 diff)
Mtests/two_parent_workspace_add_drop_rename/__driver__.lua (1 diff)
Mtests/two_parent_workspace_annotate/__driver__.lua (1 diff)
Mtests/two_parent_workspace_attrs/__driver__.lua (1 diff)
Mtests/two_parent_workspace_commands_that_fail/__driver__.lua (2 diffs)
Mtests/two_parent_workspace_inodeprint_from_birth/__driver__.lua (3 diffs)
Mtests/two_parent_workspace_inodeprints/__driver__.lua (2 diffs)
Mtests/two_parent_workspace_list/__driver__.lua (1 diff)
Mtests/two_parent_workspace_pivot_root/__driver__.lua (1 diff)
Mtests/two_parent_workspace_pluck/__driver__.lua (1 diff)
Mtests/unnormalized_paths_in_database/__driver__.lua (1 diff)
Mtests/update_to_off-branch_rev/__driver__.lua (1 diff)
Mtests/updating_through_a_pivot_root/__driver__.lua (1 diff)
Mtests/use_restrictions_with_--exclude_and_inodeprints/__driver__.lua (1 diff)
Mtests/workspace_migration/__driver__.lua (2 diffs)
Mtests/workspace_migration/inodeprints.lua (1 diff)
Mtests/workspace_migration/twoparent.lua (1 diff)
Mtestsuite.lua (1 diff)

File differences

tests/_MTN_case-folding_security_patch/__driver__.lua
6262
6363
6464
65
65
6666
get(i..".db.dumped", "stdin")
check(mtn("db", "load", "-d", i..".mtn"), 0, false, false, true)
check(mtn("db", "migrate", "-d", i..".mtn"), 0, false, false)
check(mtn("-d", i..".mtn", "db", "regenerate_caches"), 3, false, false)
check(mtn("-d", i..".mtn", "db", "regenerate-caches"), 3, false, false)
end
tests/a_tricky_cvs_repository_with_tags/__driver__.lua
77
88
99
10
10
1111
1212
1313
check(get("cvs-repository"))
check(mtn("--branch=foo.bar", "cvs_import", "cvs-repository"), 0, false, false)
check(mtn("--branch=foo.bar", "cvs-import", "cvs-repository"), 0, false, false)
check(mtn("--branch=foo.bar", "checkout"), 0, false, true)
check(indir("foo.bar", mtn("automate", "get_manifest_of")), 0, true)
canonicalize("stdout")
tests/common/automate_ancestry.lua
2525
2626
2727
28
28
2929
3030
3131
commit()
revs.e = base_revision()
check(mtn("explicit_merge", revs.d, revs.e, "testbranch"), 0, false, false)
check(mtn("explicit-merge", revs.d, revs.e, "testbranch"), 0, false, false)
check(mtn("update"), 0, false, false)
revs.f = base_revision()
tests/cvs_import,_deleted_file_invariant/__driver__.lua
1313
1414
1515
16
16
1717
1818
1919
tsha2 = sha1("cfile")
-- import into monotone and check presence of files
check(mtn("--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false)
check(mtn("--branch=testbranch", "cvs-import", "cvs-repository/test"), 0, false, false)
check(mtn("automate", "get_file", tsha0), 0, false)
check(mtn("automate", "get_file", tsha1), 0, false)
tests/cvs_import,_file_dead_on_head_and_branch/__driver__.lua
1010
1111
1212
13
13
1414
1515
-- import into monotone and check presence of files
check(mtn("--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false)
check(mtn("--branch=testbranch", "cvs-import", "cvs-repository/test"), 0, false, false)
check(mtn("automate", "get_file", tsha), 0, false)
tests/cvs_import_with_file_added_on_a_branch/__driver__.lua
99
1010
1111
12
12
-- file on mainline, followed by an add of the file on the branch).
-- Make sure we handle it correct.
check(mtn("--branch=test", "cvs_import", "cvs-repository"), 0, false, false)
check(mtn("--branch=test", "cvs-import", "cvs-repository"), 0, false, false)
tests/db_data_format_checking/__driver__.lua
2323
2424
2525
26
26
2727
2828
check(mtn("-d", "ro-modern.db", "ls", "keys"), 1, false, false)
check(mtn("-d", "ro-modern.db", "serve", "--bind=127.0.0.1:63219"), 1, false, false)
-- arguably "db regenerate_caches" should go here too -- it's treated
-- arguably "db regenerate-caches" should go here too -- it's treated
-- similarly. But the test "schema_migration" tests for its behavior in this
-- case.
tests/db_kill_branch_certs_locally_command/__driver__.lua
11
22
33
4
4
55
66
77
......
1313
1414
1515
16
16
1717
1818
1919
mtn_setup()
-- This tests the db kill_branch_certs_locally command
-- This tests the db kill-branch-certs-locally command
-- Prepare a db with a couple of branches
addfile("foo", "file named foo")
check(qgrep("bad", "stdout"))
-- Now we delete the branch, and make sure it's gone
check(mtn("db", "kill_branch_certs_locally", "bad"), 0, false, false)
check(mtn("db", "kill-branch-certs-locally", "bad"), 0, false, false)
check(mtn("ls", "branches"), 0, true, false)
check(qgrep("good", "stdout"))
check(not qgrep("bad", "stdout"))
tests/db_kill_rev_and_recommit/__driver__.lua
1919
2020
2121
22
23
22
23
2424
2525
2626
chdir("..")
-- kill_rev_locally the new child
check(mtn("db", "kill_rev_locally", new_rev1))
-- kill-rev-locally the new child
check(mtn("db", "kill-rev-locally", new_rev1))
-- recreate and attempt to commit the same child again from base
mkdir("test2")
tests/db_kill_rev_locally_command/__driver__.lua
11
22
33
4
4
55
66
77
......
1313
1414
1515
16
17
16
17
1818
1919
2020
2121
22
23
22
23
2424
mtn_setup()
-- This tests the db kill_rev_locally command
-- This tests the db kill-rev-locally command
-- Prepare a db with two revisions
addfile("testfile", "blah blah")
child = base_revision()
-- trying to kill the ancestor. This *is supposed to fail*
check(mtn("db", "kill_rev_locally", ancestor), 1, false, false)
check(mtn("automate", "get_revision", ancestor), 0, false, false)
check(mtn("db", "kill-rev-locally", ancestor), 1, false, false)
check(mtn("automate", "get-revision", ancestor), 0, false, false)
check(mtn("db", "check"), 0, false, false)
-- killing children is ok, though :)
check(mtn("automate", "get_revision", child), 0, false, false)
check(mtn("db", "kill_rev_locally", child), 0, false, false)
check(mtn("automate", "get_revision", child), 1, false, false)
check(mtn("db", "kill-rev-locally", child), 0, false, false)
check(mtn("automate", "get-revision", child), 1, false, false)
check(mtn("db", "check"), 0, false, false)
tests/db_kill_rev_locally_command_2/__driver__.lua
1616
1717
1818
19
20
19
20
2121
2222
2323
2424
25
26
25
26
2727
-- kill head revision
check(mtn("automate", "get_revision", child2), 0, false, false)
check(mtn("db", "kill_rev_locally", child2), 0, false, false)
check(mtn("automate", "get_revision", child2), 1, false, false)
check(mtn("db", "kill-rev-locally", child2), 0, false, false)
check(mtn("automate", "get-revision", child2), 1, false, false)
check(mtn("db", "check"), 0, false, false)
-- head is an older revision now, let's kill that too
check(mtn("automate", "get_revision", child1), 0, false, false)
check(mtn("db", "kill_rev_locally", child1), 0, false, false)
check(mtn("automate", "get_revision", child1), 1, false, false)
check(mtn("db", "kill-rev-locally", child1), 0, false, false)
check(mtn("automate", "get-revision", child1), 1, false, false)
check(mtn("db", "check"), 0, false, false)
tests/db_kill_tag_locally/__driver__.lua
3232
3333
3434
35
35
3636
3737
3838
......
4444
4545
4646
47
47
4848
4949
5050
check(qgrep(R4, "stdout"))
check(qgrep("other_tag", "stdout"))
check(mtn("db", "kill_tag_locally", "test_tag"), 0, false, false)
check(mtn("db", "kill-tag-locally", "test_tag"), 0, false, false)
check(mtn("ls", "tags"), 0, true, false)
check(qgrep(R1, "stdout"))
check(qgrep(R4, "stdout"))
check(qgrep("other_tag", "stdout"))
check(mtn("db", "kill_tag_locally", "ambig_tag"), 0, false, false)
check(mtn("db", "kill-tag-locally", "ambig_tag"), 0, false, false)
check(mtn("ls", "tags"), 0, true, false)
check(not qgrep(R1, "stdout"))
tests/explicit_merge/__driver__.lua
2424
2525
2626
27
27
2828
2929
3030
commit()
right = base_revision()
check(mtn("explicit_merge", left, right, "otherbranch"), 0, false, false)
check(mtn("explicit-merge", left, right, "otherbranch"), 0, false, false)
-- Check that it didn't end up on our current branch, i.e. update doesn't do anything
check(mtn("update"), 0, false, false)
tests/explicit_merge_LEFT_RIGHT_ANC_BRANCH/__driver__.lua
2323
2424
2525
26
26
2727
28
28
2929
3030
3131
right = base_revision()
-- This should fail:
xfail_if(true, mtn("explicit_merge", left, right, bad_anc, "testbranch"), 1, false, false)
xfail_if(true, mtn("explicit-merge", left, right, bad_anc, "testbranch"), 1, false, false)
-- But this should work:
xfail_if(true, mtn("explicit_merge", left, right, good_anc, "testbranch"), 0, false, false)
xfail_if(true, mtn("explicit-merge", left, right, good_anc, "testbranch"), 0, false, false)
-- And produce the logical result:
check(mtn("update"), 0, false, false)
writefile("expected", "a\nNEW\nc\nNEW\ne\n")
tests/importing_a_cvs_file_with_one_version/__driver__.lua
88
99
1010
11
11
1212
writefile("foo", "version 0 of test file foo\n")
tsha = sha1("foo")
check(mtn("--branch=testbranch", "cvs_import", "cvs-repository"), 0, false, false)
check(mtn("--branch=testbranch", "cvs-import", "cvs-repository"), 0, false, false)
check(mtn("automate", "get_file", tsha), 0, false)
tests/importing_a_small,_real_cvs_repository/__driver__.lua
55
66
77
8
8
99
1010
1111
check(get("cvs-repository"))
check(mtn("--branch=foo.bar", "cvs_import", "cvs-repository"), 0, false, false)
check(mtn("--branch=foo.bar", "cvs-import", "cvs-repository"), 0, false, false)
check(mtn("--branch=foo.bar.disasm-branch", "checkout"), 0, true, true)
check(indir("foo.bar.disasm-branch", mtn("automate", "get_manifest_of")), 0, true)
canonicalize("stdout")
tests/importing_cvs_branches_with_correct_ancestory/__driver__.lua
2828
2929
3030
31
31
3232
3333
3434
-- import into monotone and check presence of files
check(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false)
check(mtn("--branch=test", "cvs-import", "cvs-repository/test"), 0, false, false)
-- check if all branches were imported
check(mtn("list", "branches"), 0, true, false)
tests/importing_cvs_files/__driver__.lua
1414
1515
1616
17
17
1818
1919
20
20
2121
2222
23
23
2424
2525
2626
tsha3 = sha1("foo.3")
-- safety check -- we stop people from accidentally feeding their whole
-- repo to cvs_import instead of just a module. For that, we re-add the
-- repo to cvs-import instead of just a module. For that, we re-add the
-- CVSROOT bookkeeping directory
mkdir("cvs-repository/CVSROOT")
check(mtn("--branch=testbranch", "cvs_import", "cvs-repository"), 1, false, false)
check(mtn("--branch=testbranch", "cvs-import", "cvs-repository"), 1, false, false)
-- import into monotone and check presence of files
check(mtn("--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false)
check(mtn("--branch=testbranch", "cvs-import", "cvs-repository/test"), 0, false, false)
check(mtn("automate", "get_file", tsha0), 0, false)
check(mtn("automate", "get_file", tsha1), 0, false)
check(mtn("automate", "get_file", tsha2), 0, false)
tests/importing_cvs_files_with_identical_logs/__driver__.lua
1414
1515
1616
17
17
1818
1919
2020
tsha3 = sha1("foo.3")
-- import into monotone and check presence of files
check(mtn("--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false)
check(mtn("--branch=testbranch", "cvs-import", "cvs-repository/test"), 0, false, false)
check(mtn("automate", "get_file", tsha0), 0, false)
check(mtn("automate", "get_file", tsha1), 0, false)
check(mtn("automate", "get_file", tsha2), 0, false)
tests/importing_cvs_with_vendor_imports_and_branches/__driver__.lua
1717
1818
1919
20
20
2121
2222
2323
-- import into monotone and check presence of files
check(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false)
check(mtn("--branch=test", "cvs-import", "cvs-repository/test"), 0, false, false)
check(mtn("checkout", "--branch=test", "maindir"), 0, false, false)
check(mtn("checkout", "--branch=test.branched", "branchdir"), 0, false, false)
tests/inodeprints/__driver__.lua
3535
3636
3737
38
38
3939
4040
4141
check(mtn("diff"), 0, true, false)
check(qgrep("stuff stuff", "stdout"))
-- Should have changed the inodeprints file
check(mtn("refresh_inodeprints"), 0, false, false)
check(mtn("refresh-inodeprints"), 0, false, false)
check(not samefile("_MTN/inodeprints", "ip1"))
-- Make sure partial commit doesn't screw things up
tests/ls_epochs/__driver__.lua
77
88
99
10
11
12
10
11
12
1313
1414
1515
addfile("testfile2", "other data")
commit("otherbranch")
check(mtn("db", "set_epoch", "testbranch", "12345"), 1, false, false)
check(mtn("db", "set_epoch", "testbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set_epoch", "otherbranch", string.rep("b", 40)), 0, false, false)
check(mtn("db", "set-epoch", "testbranch", "12345"), 1, false, false)
check(mtn("db", "set-epoch", "testbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set-epoch", "otherbranch", string.rep("b", 40)), 0, false, false)
check(mtn("list", "epochs"), 0, true)
check(qgrep("testbranch", "stdout"))
tests/merge_a_project_into_a_subdirectory_of_an_unrelated_project/__driver__.lua
1313
1414
1515
16
16
1717
1818
1919
addfile("dir/quux", "baz")
commit("b2")
check(mtn("merge_into_dir", "b1", "b2", "dir/zuul"), 0, false, false)
check(mtn("merge-into-dir", "b1", "b2", "dir/zuul"), 0, false, false)
check(mtn("checkout", "-b", "b2", "checkout"), 0, false, true)
check(exists("checkout/file2"))
tests/merge_conflict_with_no_lca/__driver__.lua
1414
1515
1616
17
17
1818
1919
2020
2121
2222
23
23
2424
2525
2626
netsync.sync("*branch")
append("foo", "bar\n")
commit()
check(mtn("merge_into_dir", "otherbranch", "testbranch", "test"), 0, false, false)
check(mtn("merge-into-dir", "otherbranch", "testbranch", "test"), 0, false, false)
check(mtn("update", "-r", base), 0, false, false)
append("foo", "baz\n")
commit(nil, nil, mtn2)
check(mtn2("merge_into_dir", "otherbranch", "testbranch", "test"), 0, false, false)
check(mtn2("merge-into-dir", "otherbranch", "testbranch", "test"), 0, false, false)
check(get("rcfile"))
check(mtn("merge", "--rcfile", "rcfile"), 0, false, false)
tests/merge_into_workspace/__driver__.lua
1
1
22
33
44
......
4949
5050
5151
52
52
5353
5454
5555
5656
5757
58
58
5959
6060
6161
62
62
6363
6464
6565
-- this is very similar to the explicit_merge test, except that the
-- this is very similar to the explicit-merge test, except that the
-- result of the merge winds up in the current workspace.
function samefile_ignore_dates(a, b)
check(mtn("automate", "graph"), 0, true, nil)
rename("stdout", "ancestry")
-- we're currently at "right", so a merge_into_workspace of "left"
-- we're currently at "right", so a merge-into-workspace of "left"
-- is the merge we want; but first, test the sanity checks
copy("otherfile_mod", "otherfile")
-- this should fail, because the workspace is unclean
check(mtn("merge_into_workspace", left), 1, false, false)
check(mtn("merge-into-workspace", left), 1, false, false)
-- after reverting, it should work
check(mtn("revert", "otherfile"), 0, false, false)
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
-- testfile should be the same as merged
check(samefile("merged", "testfile"))
tests/merge_into_workspace_attr_corpse/__driver__.lua
2828
2929
3030
31
31
3232
3333
3434
......
4242
4343
4444
45
45
4646
4747
4848
rename("stdout", "ancestry")
-- the merge should succeed
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
-- the database should be unaffected, i.e. the operation
-- should not have created any new revisions
-- in-database merge would generate; in particular, both "left-attr"
-- and "right-attr" should show up as "dormant_attr"s.
check(get("expected-roster"))
check(mtn("get_roster"), 0, true, nil)
check(mtn("get-roster"), 0, true, nil)
canonicalize("stdout")
check(samefile("expected-roster", "stdout"))
tests/merge_into_workspace_files_added/__driver__.lua
2828
2929
3030
31
31
3232
3333
3434
rename("stdout", "ancestry")
-- the merge should succeed
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
-- testfile, left, right should all exist and equal their originals
tests/merge_into_workspace_no_changes/__driver__.lua
3434
3535
3636
37
37
3838
3939
4040
......
4949
5050
5151
52
52
5353
5454
5555
rename("stdout", "ancestry")
-- the merge should succeed
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
-- testfile should be the same as left
check(samefile("left", "testfile"))
-- we should not be able to merge anything on top of this, despite
-- there being no changes in the workspace
check(mtn("merge_into_workspace", unrelated), 1, false, false)
check(mtn("merge-into-workspace", unrelated), 1, false, false)
-- a commit at this point should succeed, again despite having no changes
commit()
tests/merge_into_workspace_same_rev/__driver__.lua
99
1010
1111
12
12
other = base_revision()
-- try merging the current workspace head into the workspace
check(mtn("merge_into_workspace", other), 1, nil, false)
check(mtn("merge-into-workspace", other), 1, nil, false)
tests/merge_rev_with_ancestor/__driver__.lua
1717
1818
1919
20
21
20
21
commit()
r2 = base_revision()
check(mtn("explicit_merge", r0, r1, "testbranch"), 1, false, false)
check(mtn("explicit_merge", r1, r0, "testbranch"), 1, false, false)
check(mtn("explicit-merge", r0, r1, "testbranch"), 1, false, false)
check(mtn("explicit-merge", r1, r0, "testbranch"), 1, false, false)
tests/migrate_workspace/__driver__.lua
1
1
22
33
44
55
6
6
77
8
8
99
1010
1111
12
12
1313
1414
1515
16
16
1717
1818
19
19
2020
2121
2222
2323
2424
25
25
2626
2727
2828
......
3636
3737
3838
39
39
4040
4141
-- General checks of the migrate_workspace command; see workspace_migration
-- General checks of the migrate-workspace command; see workspace_migration
-- for exhaustive checks of migration from each possible format version.
mtn_setup()
-- mtn migrate_workspace requires a workspace.
-- mtn migrate-workspace requires a workspace.
rename("_MTN","_MTN.not")
check(mtn("migrate_workspace"), 1, nil, true)
check(mtn("migrate-workspace"), 1, nil, true)
check(qgrep("workspace required but not found", "stderr"))
rename("_MTN.not","_MTN")
-- Given a workspace in the current format, migrate_workspace should
-- Given a workspace in the current format, migrate-workspace should
-- just print a message and exit successfully.
addfile("foo", "foo")
commit()
check(mtn("migrate_workspace"), 0, nil, true)
check(mtn("migrate-workspace"), 0, nil, true)
check(qgrep("workspace is in the current format", "stderr"))
-- Given a workspace in an absurdly high format, migrate_workspace
-- Given a workspace in an absurdly high format, migrate-workspace
-- should fail, and so should ordinary operations on the workspace.
writefile("_MTN/format", "999999999\n")
check(mtn("status"), 1, nil, true)
check(qgrep("need a newer version", "stderr"))
check(qgrep("^999999999$", "_MTN/format"))
check(mtn("migrate_workspace"), 1, nil, true)
check(mtn("migrate-workspace"), 1, nil, true)
check(qgrep("need a newer version", "stderr"))
check(qgrep("^999999999$", "_MTN/format"))
check(mtn("status"), 1, nil, true)
check(qgrep("metadata is in format 0", "stderr"))
check(exists("MT"))
check(mtn("migrate_workspace"), 1, nil, true)
check(mtn("migrate-workspace"), 1, nil, true)
check(qgrep("not possible to migrate from workspace format 0", "stderr"))
check(exists("MT"))
tests/netsync_client_absorbs_and_checks_epochs/__driver__.lua
3434
3535
3636
37
38
39
37
38
39
4040
4141
4242
revs[1] = base_revision()
-- change the epochs in the first db
check(mtn("db", "set_epoch", "testbranch", "12345"), 1, false, false)
check(mtn("db", "set_epoch", "testbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set_epoch", "otherbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set-epoch", "testbranch", "12345"), 1, false, false)
check(mtn("db", "set-epoch", "testbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set-epoch", "otherbranch", string.rep("a", 40)), 0, false, false)
-- this should *fail* to sync
srv = netsync.start()
tests/netsync_epoch_refinement/__driver__.lua
88
99
1010
11
12
11
12
1313
1414
1515
addfile("foo", "foo")
commit()
check(mtn("db", "set_epoch", "testbranch", string.rep("1234567890", 4)))
check(mtn2("db", "set_epoch", "testbranch", string.rep("1234567890", 4)))
check(mtn("db", "set-epoch", "testbranch", string.rep("1234567890", 4)))
check(mtn2("db", "set-epoch", "testbranch", string.rep("1234567890", 4)))
-- If we completely ignore the epoch (because we already have it), we'll
-- never notice that refinement is done.
tests/netsync_hook_errcodes/__driver__.lua
6161
6262
6363
64
65
64
65
6666
6767
6868
chk_errcode_is(422)
clearnotes()
check(mtn("db", "set_epoch", "testbranch", string.rep("0", 40)))
check(mtn2("db", "set_epoch", "testbranch", string.rep("1", 40)))
check(mtn("db", "set-epoch", "testbranch", string.rep("0", 40)))
check(mtn2("db", "set-epoch", "testbranch", string.rep("1", 40)))
srv = netsync.start()
srv:push({"testbranch"}, 2, 1)
srv:stop()
tests/netsync_server_absorbs_and_checks_epochs/__driver__.lua
3636
3737
3838
39
40
39
40
4141
4242
4343
revs[1] = base_revision()
-- change the epochs in the second db
check(mtn("db", "set_epoch", "testbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set_epoch", "otherbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set-epoch", "testbranch", string.rep("a", 40)), 0, false, false)
check(mtn("db", "set-epoch", "otherbranch", string.rep("a", 40)), 0, false, false)
-- this should *fail* to sync
srv = netsync.start()
tests/one-way_netsync_where_the_sink_has_more_epochs/__driver__.lua
1212
1313
1414
15
15
1616
1717
1818
addfile("foo", "foo")
commit()
check(mtn("db", "set_epoch", "testbranch", string.rep("1234567890", 4)))
check(mtn("db", "set-epoch", "testbranch", string.rep("1234567890", 4)))
remove("_MTN")
check(mtn2("setup", "-b", "otherbranch", "."), 0, false, false)
writefile("bar", "bar")
tests/pivot_root/__driver__.lua
2323
2424
2525
26
27
28
29
30
31
26
27
28
29
30
31
3232
3333
3434
3535
3636
37
37
3838
3939
4040
check(indir("workspace", mtn("commit", "-m", "foo")), 0, false, false)
check(indir("workspace", mtn("pivot_root", "--bookkeep-only", "nosuchdir", "foo")), 1, false, false)
check(indir("workspace", mtn("pivot_root", "--bookkeep-only", "dir1/file1", "foo")), 1, false, false)
check(indir("workspace", mtn("pivot_root", "--bookkeep-only", "dir3", "old_root")), 1, false, false)
check(indir("workspace", mtn("pivot_root", "--bookkeep-only", "dir1", "nosuchdir/old_root")), 1, false, false)
check(indir("workspace", mtn("pivot_root", "--bookkeep-only", "dir1", "file1/old_root")), 1, false, false)
check(indir("workspace", mtn("pivot_root", "--bookkeep-only", "dir1", "dir2")), 1, false, false)
check(indir("workspace", mtn("pivot-root", "--bookkeep-only", "nosuchdir", "foo")), 1, false, false)
check(indir("workspace", mtn("pivot-root", "--bookkeep-only", "dir1/file1", "foo")), 1, false, false)
check(indir("workspace", mtn("pivot-root", "--bookkeep-only", "dir3", "old_root")), 1, false, false)
check(indir("workspace", mtn("pivot-root", "--bookkeep-only", "dir1", "nosuchdir/old_root")), 1, false, false)
check(indir("workspace", mtn("pivot-root", "--bookkeep-only", "dir1", "file1/old_root")), 1, false, false)
check(indir("workspace", mtn("pivot-root", "--bookkeep-only", "dir1", "dir2")), 1, false, false)
check(indir("workspace", mtn("ls", "changed")), 0)
check(indir("workspace", mtn("ls", "missing")), 0)
check(indir("workspace", mtn("ls", "unknown")), 0)
check(indir("workspace", mtn("pivot_root", "dir1", "old_root")), 0, false, false)
check(indir("workspace", mtn("pivot-root", "dir1", "old_root")), 0, false, false)
check(isdir("workspace/_MTN"))
check(isdir("workspace/dir2"))
tests/pivot_root_to_new_dir/__driver__.lua
11
22
3
3
44
55
66
......
1414
1515
1616
17
17
1818
1919
2020
mtn_setup()
-- pivot_root to a directory that hasn't been commited yet should work
-- pivot-root to a directory that hasn't been commited yet should work
mkdir("workspace")
check(indir("workspace", mtn("setup", ".", "-b", "testbranch")),
mkdir("workspace/new_root")
check(indir("workspace", mtn("add", "new_root")), 0, false, false)
check(indir("workspace", mtn("pivot_root", "new_root", "Attic")),
check(indir("workspace", mtn("pivot-root", "new_root", "Attic")),
0, false, false)
check(isdir("workspace/_MTN"))
tests/pluck_lifecycle/__driver__.lua
4040
4141
4242
43
43
4444
4545
4646
two_rev = base_revision()
-- and merge 1
check(mtn("explicit_merge", one_rev, two_rev, "testbranch"), 0, false, false)
check(mtn("explicit-merge", one_rev, two_rev, "testbranch"), 0, false, false)
check(mtn("update"), 0, false, false)
-- check that we need the edit for b
tests/refresh_inodeprints/__driver__.lua
66
77
88
9
9
1010
1111
check(not exists("_MTN/inodeprints"))
check(mtn("refresh_inodeprints"))
check(mtn("refresh-inodeprints"))
check(exists("_MTN/inodeprints"))
check(fsize("_MTN/inodeprints") ~= 0)
tests/restricted_commit_with_inodeprints/__driver__.lua
1414
1515
1616
17
17
1818
1919
2020
......
2323
2424
2525
26
26
2727
2828
2929
-- would not be updated but the old cached value can't possibly equal the current
-- value since the file does not exist and cannot have an inodeprint.
-- also, it may be a useful feature (?) to allow refresh_inodeprints to update
-- also, it may be a useful feature (?) to allow refresh-inodeprints to update
-- its cache for a restricted set of files by allowing paths on the command line
-- to establish a restriction.
commit()
-- enable inodeprints mode
check(mtn("refresh_inodeprints"), 0, false, false)
check(mtn("refresh-inodeprints"), 0, false, false)
addfile("file2", "file2")
tests/reverting_a_pivot_root/__driver__.lua
1717
1818
1919
20
20
2121
2222
2323
check(indir("workspace", mtn("commit", "-m", "foo")), 0, false, false)
check(indir("workspace", mtn("pivot_root", "dir1", "old_root")), 0, false, false)
check(indir("workspace", mtn("pivot-root", "dir1", "old_root")), 0, false, false)
check(isdir("workspace/_MTN"))
check(isdir("workspace/dir2"))
tests/schema_migration/__driver__.lua
9090
9191
9292
93
93
9494
9595
96
96
9797
9898
99
99
100100
101
101
102102
103103
104
104
105105
106106
107
107
108108
109109
110
110
111111
112112
113113
check(qgrep(id, "stdout"))
-- migrate it
check(mtn("--db="..id..".mtn", "db", "migrate"), 0, false, true)
-- check to see if it told us to regenerate_caches
-- check to see if it told us to regenerate-caches
if (need_regen_rosters) then
-- then the migrate should have warned us
check(string.find(readfile("stderr"), "regenerate_caches") ~= nil)
check(qgrep("regenerate-caches", "stderr"))
-- and normal commands on the db should notice the problem and error out
check(mtn("--db="..id..".mtn", "ls", "keys"), 1, false, true)
check(qgrep("regenerate_caches", "stderr"))
check(qgrep("regenerate-caches", "stderr"))
-- and we should do the regeneration
check(mtn("--db="..id..".mtn", "db", "regenerate_caches"), 0, false, false)
check(mtn("--db="..id..".mtn", "db", "regenerate-caches"), 0, false, false)
-- after which, normal commands should work again
check(mtn("--db="..id..".mtn", "ls", "keys"), 0, false, true)
check(not qgrep("regenerate_caches", "stderr"))
check(not qgrep("regenerate-caches", "stderr"))
else
-- then the migrate should not have warned us
check(string.find(readfile("stderr"), "regenerate_caches") == nil)
check(string.find(readfile("stderr"), "regenerate-caches") == nil)
-- and normal commands on the db should work fine
check(mtn("--db="..id..".mtn", "ls", "keys"), 0, false, true)
check(not qgrep("regenerate_caches", "stderr"))
check(not qgrep("regenerate-caches", "stderr"))
end
check_same_db_contents(id..".mtn", "latest.mtn")
end
tests/schema_migration_error_recovery/__driver__.lua
88
99
1010
11
11
1212
1313
1414
db = tag .. ".mtn"
check(get(dump))
check(raw_mtn("db", "load", "-d", db), 0, nil, nil, {dump})
check(raw_mtn("test_migration_step", target, "-d", db), 1, nil, true)
check(raw_mtn("test-migration-step", target, "-d", db), 1, nil, true)
check(qgrep(diagnostic, "stderr"))
end
tests/show_conflicts/__driver__.lua
1717
1818
1919
20
20
2121
2222
2323
commit("branch")
right = base_revision()
check(mtn("show_conflicts", left, right), 0, false, true)
check(mtn("show-conflicts", left, right), 0, false, true)
rename("stderr", "conflicts")
check(qgrep("There are 1 node_name_conflicts", "conflicts"))
tests/ssh_agent/__driver__.lua
11
22
3
3
44
55
66
......
1212
1313
1414
15
15
1616
1717
1818
1919
2020
21
21
2222
2323
24
24
2525
2626
27
27
2828
2929
30
30
3131
3232
3333
......
4545
4646
4747
48
49
48
49
5050
5151
5252
......
154154
155155
156156
157
157
158158
159159
160160
......
191191
192192
193193
194
194
195195
196196
197197
198198
199199
200200
201
201
202202
203203
204
204
205205
206206
207207
208
208
209209
210
210
211211
212212
213213
......
253253
254254
255255
256
256
257257
258258
259259
260
260
261261
262262
263263
-- with no monotone keys:
-- * (E) export monotone key
check(mtn("ssh_agent_export"), 1, false, false)
check(mtn("ssh-agent-export"), 1, false, false)
mtn_setup()
check(mtn("ci", "--message", "commit msg"), 0, false, false)
-- * (E) export key with -k that does not exist
check(mtn("--key", "n@n.com", "ssh_agent_export"), 1, false, false)
check(mtn("--key", "n@n.com", "ssh-agent-export"), 1, false, false)
-- * (ok) export key without -k
check(raw_mtn("--rcfile", test.root .. "/test_hooks.lua", -- "--nostd",
"--db=" .. test.root .. "/test.db",
"--keydir", test.root .. "/keys",
"ssh_agent_export"), 0, false, false)
"ssh-agent-export"), 0, false, false)
-- * (ok) export key with -k that does exist
check(mtn("--key", "tester@test.net", "ssh_agent_export"), 0, false, false)
check(mtn("--key", "tester@test.net", "ssh-agent-export"), 0, false, false)
-- * (ok) export monotone key with passphrase
check(mtn("ssh_agent_export"), 0, false, false, tkey .. "\n" .. tkey .. "\n")
check(mtn("ssh-agent-export"), 0, false, false, tkey .. "\n" .. tkey .. "\n")
-- * (ok) export monotone key without passphrase
check(mtn("ssh_agent_export", "id_monotone"), 0, false, false)
check(mtn("ssh-agent-export", "id_monotone"), 0, false, false)
skip_if(not existsonpath("chmod"))
check({"chmod", "600", "id_monotone"}, 0, false, false)
end
end
-- * (ok) mtn ssh_agent_add adds key to agent
check(mtn("ssh_agent_add"), 0, false, false)
-- * (ok) mtn ssh-agent-add adds key to agent
check(mtn("ssh-agent-add"), 0, false, false)
check({"ssh-add", "-l"}, 0, true, false)
ok = false
for line in io.lines("stdout") do
check(mtn("ci", "--message", "commit msg"), 0, false, false)
-- * (ok) export key with password
check(mtn("ssh_agent_export", "id_monotone_pass"), 0, false, false, "\npass\npass\n")
check(mtn("ssh-agent-export", "id_monotone_pass"), 0, false, false, "\npass\npass\n")
skip_if(not existsonpath("chmod"))
check({"chmod", "600", "id_monotone_pass"}, 0, false, false)
check(raw_mtn("--rcfile", test.root .. "/test_hooks.lua", -- "--nostd",
"--db=" .. test.root .. "/test.db",
"--keydir", test.root .. "/keys",
"ssh_agent_export"), 1, false, false)
"ssh-agent-export"), 1, false, false)
-- * (N) try to add monotone key without -k
remove("_MTN/options")
check(raw_mtn("--rcfile", test.root .. "/test_hooks.lua", -- "--nostd",
"--db=" .. test.root .. "/test.db",
"--keydir", test.root .. "/keys",
"ssh_agent_add"), 1, false, false)
"ssh-agent-add"), 1, false, false)
-- * (ok) export monotone key with -k
check(mtn("ssh_agent_export", "--key", "test2@tester.net", "id_monotone2"), 0, false, false)
check(mtn("ssh-agent-export", "--key", "test2@tester.net", "id_monotone2"), 0, false, false)
skip_if(not existsonpath("chmod"))
check({"chmod", "600", "id_monotone2"}, 0, false, false)
-- * (ok) mtn ssh_agent_add with -k adds key to agent
-- * (ok) mtn ssh-agent-add with -k adds key to agent
check({"ssh-add", "-D"}, 0, false, false)
check(mtn("ssh_agent_add", "--key", "test2@tester.net"), 0, false, false)
check(mtn("ssh-agent-add", "--key", "test2@tester.net"), 0, false, false)
check({"ssh-add", "-l"}, 0, true, false)
ok = false
for line in io.lines("stdout") do
-- * (ok) create passworded key and export it
check({"ssh-add", "-D"}, 0, false, false)
check(mtn("genkey", "test_pass@tester.net"), 0, false, false, "pass\npass\n")
check(mtn("ssh_agent_export", "--key", "test_pass@tester.net"), 0, false, false, "pass\npass2\npass2\n")
check(mtn("ssh-agent-export", "--key", "test_pass@tester.net"), 0, false, false, "pass\npass2\npass2\n")
-- * (ok) add passworded key
check({"ssh-add", "-D"}, 0, false, false)
check(mtn("ssh_agent_add", "--key", "test_pass@tester.net"), 0, false, false, "pass\n")
check(mtn("ssh-agent-add", "--key", "test_pass@tester.net"), 0, false, false, "pass\n")
check({"ssh-add", "-l"}, 0, true, false)
ok = false
for line in io.lines("stdout") do
tests/test_a_merge_7/__driver__.lua
4343
4444
4545
46
46
4747
4848
4949
commit()
revs.d = base_revision()
check(mtn("explicit_merge", revs.d, revs.c, "testbranch"), 0, false, false)
check(mtn("explicit-merge", revs.d, revs.c, "testbranch"), 0, false, false)
check(mtn("update"), 0, false, false)
revs.e = base_revision()
tests/test_problematic_cvs_import/__driver__.lua
1010
1111
1212
13
13
-- This rcs file fails to be imported correctly by monotone
check(get("cvs-repository"))
xfail_if(true, mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, ignore, ignore)
xfail_if(true, mtn("--branch=test", "cvs-import", "cvs-repository/test"), 0, ignore, ignore)
tests/two_parent_workspace_add_drop_rename/__driver__.lua
1212
1313
1414
15
15
1616
1717
1818
writefile("foo", "ancestor\nright")
commit()
check(mtn("merge_into_workspace", other), 0, false, false)
check(mtn("merge-into-workspace", other), 0, false, false)
writefile("fudgie", "fudgie content")
tests/two_parent_workspace_annotate/__driver__.lua
2323
2424
2525
26
26
2727
2828
2929
commit()
right = base_revision()
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
-- testfile should be the same as merged
check(samefile("merged", "testfile"))
tests/two_parent_workspace_attrs/__driver__.lua
1616
1717
1818
19
19
2020
2121
2222
commit()
right = base_revision()
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
check(qgrep("left", "testfile"))
check(qgrep("right", "testfile"))
check(not qgrep("ancestor", "testfile"))
tests/two_parent_workspace_commands_that_fail/__driver__.lua
2020
2121
2222
23
23
2424
2525
2626
......
2929
3030
3131
32
32
3333
3434
3535
commit()
right = base_revision()
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
check(qgrep("left", "testfile"))
check(qgrep("right", "testfile"))
check(not qgrep("ancestor", "testfile"))
diffdiag = ("mtn: misuse: this workspace has more than one parent\n"..
"mtn: misuse: (specify a revision to diff against with --revision)\n")
check(mtn("merge_into_workspace", anc), 1, nil, diag)
check(mtn("merge-into-workspace", anc), 1, nil, diag)
-- diff with no arguments: what parent?
check(mtn("diff"), 1, nil, diffdiag)
tests/two_parent_workspace_inodeprint_from_birth/__driver__.lua
2828
2929
3030
31
31
3232
3333
3434
......
4343
4444
4545
46
46
4747
4848
4949
......
5454
5555
5656
57
57
5858
5959
6060
6161
6262
6363
64
64
6565
6666
67
67
6868
6969
70
70
7171
7272
-- create second child from ancestor (right)
revert_to(anc)
sleep(5)
check(mtn("refresh_inodeprints"), 0, false, false)
check(mtn("refresh-inodeprints"), 0, false, false)
check(qgrep("foo", "_MTN/inodeprints"))
check(not qgrep("right", "_MTN/inodeprints"))
check(qgrep("foo", "_MTN/inodeprints"))
-- now create a two parent workspace
check(mtn("merge_into_workspace", other), 0, false, false)
check(mtn("merge-into-workspace", other), 0, false, false)
check(fsize("_MTN/inodeprints") ~= 0)
check(qgrep("bar", "_MTN/inodeprints"))
-- left and right are unchanged, but added in the other parent, so should be
-- inodeprinted, except that left was added during the merge_into_workspace,
-- inodeprinted, except that left was added during the merge-into-workspace,
-- so it might be too new to be inodeprinted (depending on the speed the
-- test happens to run), so we don't check for it.
check(qgrep("right", "_MTN/inodeprints"))
-- wait a bit, refresh, and check that left shows up now
sleep(5)
check(mtn("refresh_inodeprints"))
check(mtn("refresh-inodeprints"))
check(qgrep("left", "_MTN/inodeprints"))
-- test explicit refresh_inodeprints
-- test explicit refresh-inodeprints
addfile("in-two-parent", "in-two-parent's file content")
sleep(5)
check(mtn("refresh_inodeprints"), 0, false, false)
check(mtn("refresh-inodeprints"), 0, false, false)
check(fsize("_MTN/inodeprints") ~= 0)
check(qgrep("in-two-parent", "_MTN/inodeprints"))
tests/two_parent_workspace_inodeprints/__driver__.lua
1515
1616
1717
18
18
1919
2020
2121
......
4444
4545
4646
47
47
4848
4949
5050
addfile("right", "only on right")
commit()
check(mtn("merge_into_workspace", other), 0, false, false)
check(mtn("merge-into-workspace", other), 0, false, false)
-- check that we've got the expected initial status
check(mtn("status"), 0, true, false)
check(qgrep("in-two-parent", "_MTN/inodeprints"))
remove("_MTN/inodeprints")
check(mtn("refresh_inodeprints"), 0, false, false)
check(mtn("refresh-inodeprints"), 0, false, false)
check(fsize("_MTN/inodeprints") ~= 0)
check(qgrep("left", "_MTN/inodeprints"))
check(qgrep("right", "_MTN/inodeprints"))
tests/two_parent_workspace_list/__driver__.lua
2020
2121
2222
23
23
2424
2525
2626
commit()
right = base_revision()
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
check(mtn("ls", "changed"), 0, "file1\nfile2\nfile3\n", nil)
check(mtn("ls", "known"), 0, "file1\nfile2\nfile3\nfile4\n", nil)
tests/two_parent_workspace_pivot_root/__driver__.lua
2323
2424
2525
26
26
2727
2828
2929
3030
31
31
3232
3333
3434
check(indir("w3", mtn("commit", "--message", "blah-blah")), 0, false, false)
right = indir("w3", {base_revision})[1]()
check(indir("w3", mtn("merge_into_workspace", left)), 0, false, false)
check(indir("w3", mtn("merge-into-workspace", left)), 0, false, false)
check(qgrep("left", "w3/testfile"))
check(qgrep("right", "w3/testfile"))
check(not qgrep("ancestor", "w3/testfile"))
check(indir("w3", mtn("pivot_root", "newroot", "oldroot")),
check(indir("w3", mtn("pivot-root", "newroot", "oldroot")),
0, nil, false)
check(exists("w3/fileinroot"))
tests/two_parent_workspace_pluck/__driver__.lua
1919
2020
2121
22
22
2323
2424
2525
commit()
right = base_revision()
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
check(qgrep("left", "testfile"))
check(qgrep("right", "testfile"))
check(not qgrep("ancestor", "testfile"))
tests/unnormalized_paths_in_database/__driver__.lua
1818
1919
2020
21
21
check(mtn("db", "migrate", "-d", "bad.db"), 0, false, false)
check(mtn("db", "regenerate_caches", "-d", "bad.db"), 3, false, true)
check(mtn("db", "regenerate-caches", "-d", "bad.db"), 3, false, true)
tests/update_to_off-branch_rev/__driver__.lua
1818
1919
2020
21
21
2222
2323
2424
writefile("testfile", "double double")
commit("nobranch")
revs.n = base_revision()
check(mtn("db", "kill_branch_certs_locally", "nobranch"))
check(mtn("db", "kill-branch-certs-locally", "nobranch"))
check(mtn("checkout", "--branch=testbranch", "--revision", revs.t, "codir"), 0, false, false)
check(grep('^ *branch "testbranch"', "codir/_MTN/options"), 0, false, false)
tests/updating_through_a_pivot_root/__driver__.lua
1111
1212
1313
14
14
1515
1616
1717
check(indir("workspace", mtn("commit", "-m", "foo")), 0, false, false)
base = indir("workspace", {base_revision})[1]()
check(indir("workspace", mtn("pivot_root", "dir1", "old_root")), 0, false, false)
check(indir("workspace", mtn("pivot-root", "dir1", "old_root")), 0, false, false)
check(indir("workspace", mtn("commit", "-m", "foo")), 0, false, false)
check(mtn("co", "-r", base, "testspace"), 0, false, false)
tests/use_restrictions_with_--exclude_and_inodeprints/__driver__.lua
99
1010
1111
12
12
1313
1414
1515
check(mtn("add", "foo/bar"), 0, false, false)
check(mtn("ci", "-m", "x"), 0, false, false)
check(mtn("refresh_inodeprints"))
check(mtn("refresh-inodeprints"))
append("file1", "a")
append("foo/bar", "b")
check(mtn("ci", "--exclude", "foo", "-m", 'x'), 0, false, false)
tests/workspace_migration/__driver__.lua
1
1
22
33
44
......
7979
8080
8181
82
82
8383
8484
85
85
8686
8787
8888
-- This test ensures that 'mtn workspace_migrate' can take any old-format
-- This test ensures that 'mtn migrate-workspace' can take any old-format
-- workspace and move it forward to the current time; it is basically a
-- compatibility test (see also the 'schema_migration' test).
--
-- monotone notices and refuses to work
check(indir(ws, mtn("status")), 1, false, true)
-- and the error message mentions the command they should run
check(qgrep("migrate_workspace", "stderr"))
check(qgrep("migrate-workspace", "stderr"))
end
-- use raw_mtn here so it's not getting any help from the command line
check(indir(ws, raw_mtn("migrate_workspace")), 0, false, false)
check(indir(ws, raw_mtn("migrate-workspace")), 0, false, false)
-- now we should be the current version, and things should work
check(readfile(ws .. "/_MTN/format") == (current_workspace_format .. "\n"))
check_workspace_matches_current(ws, thing .. "-current")
tests/workspace_migration/inodeprints.lua
2828
2929
3030
31
31
3232
3333
3434
mkdir("newdir")
writefile("newdir/file3", "twas mimsy and the borogroves\n")
check(mtn("add", "newdir", "newdir/file3"), 0, false, false)
check(mtn("refresh_inodeprints"))
check(mtn("refresh-inodeprints"))
chdir("..")
end,
checker =
tests/workspace_migration/twoparent.lua
2424
2525
2626
27
27
2828
2929
3030
commit()
right = base_revision()
check(mtn("merge_into_workspace", left), 0, false, false)
check(mtn("merge-into-workspace", left), 0, false, false)
chdir("..")
end,
checker = function (dir, refdir) end
testsuite.lua
269269
270270
271271
272
273
274
275
272
273
274
275
276276
277277
278278
rev = trim(rev)
check_same_stdout(mtn("--db", db1, "automate", "certs", rev),
mtn("--db", db2, "automate", "certs", rev))
check_same_stdout(mtn("--db", db1, "automate", "get_revision", rev),
mtn("--db", db2, "automate", "get_revision", rev))
check_same_stdout(mtn("--db", db1, "automate", "get_manifest_of", rev),
mtn("--db", db2, "automate", "get_manifest_of", rev))
check_same_stdout(mtn("--db", db1, "automate", "get-revision", rev),
mtn("--db", db2, "automate", "get-revision", rev))
check_same_stdout(mtn("--db", db1, "automate", "get-manifest-of", rev),
mtn("--db", db2, "automate", "get-manifest-of", rev))
end
check(mtn("--db", db1, "complete", "file", ""), 0, true, false)

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status