# # # rename "tests/workspace_migration/test-1" # to "tests/workspace_migration/basic-1" # # rename "tests/workspace_migration/test-2" # to "tests/workspace_migration/basic-2" # # add_dir "tests/workspace_migration/inodeprints-1" # # add_dir "tests/workspace_migration/inodeprints-1/_MTN" # # add_dir "tests/workspace_migration/inodeprints-1/newdir" # # add_dir "tests/workspace_migration/inodeprints-2" # # add_dir "tests/workspace_migration/inodeprints-2/_MTN" # # add_dir "tests/workspace_migration/inodeprints-2/newdir" # # add_file "tests/workspace_migration/basic.lua" # content [49dbed3e6b96fb6c0ded16315b5b8aca148595e6] # # add_file "tests/workspace_migration/inodeprints-1/_MTN/inodeprints" # content [da39a3ee5e6b4b0d3255bfef95601890afd80709] # # add_file "tests/workspace_migration/inodeprints-1/_MTN/log" # content [d3664ada696aa1b7855394a2f7eee66281825adf] # # add_file "tests/workspace_migration/inodeprints-1/_MTN/monotonerc" # content [339d19b34553f03bce2ca334618ac0054a1fdd4e] # # add_file "tests/workspace_migration/inodeprints-1/_MTN/options" # content [a2a92cf608d8e19dee7ad9ac2c4c1d38e5d6bc76] # # add_file "tests/workspace_migration/inodeprints-1/_MTN/revision" # content [0b6f95ff1aa3b4d67e10d765254a26d5a37ebef8] # # add_file "tests/workspace_migration/inodeprints-1/_MTN/work" # content [345f6f7bfcc8d889dd158fe912517abae5488389] # # add_file "tests/workspace_migration/inodeprints-1/newdir/file3" # content [6cae7599afc389125f786f1d703ef2a9eea08424] # # add_file "tests/workspace_migration/inodeprints-1/renamed-testfile2" # content [535a99a5f65fad210c15c0b969d3aebe33cf405d] # # add_file "tests/workspace_migration/inodeprints-1/testfile1" # content [c01c44cca550f1b77ef5cda76c242e9c03d43cc8] # # add_file "tests/workspace_migration/inodeprints-2/_MTN/format" # content [7448d8798a4380162d4b56f9b452e2f6f9e24e7a] # # add_file "tests/workspace_migration/inodeprints-2/_MTN/inodeprints" # content [da39a3ee5e6b4b0d3255bfef95601890afd80709] # # add_file "tests/workspace_migration/inodeprints-2/_MTN/log" # content [d3664ada696aa1b7855394a2f7eee66281825adf] # # add_file "tests/workspace_migration/inodeprints-2/_MTN/monotonerc" # content [339d19b34553f03bce2ca334618ac0054a1fdd4e] # # add_file "tests/workspace_migration/inodeprints-2/_MTN/options" # content [a2a92cf608d8e19dee7ad9ac2c4c1d38e5d6bc76] # # add_file "tests/workspace_migration/inodeprints-2/_MTN/revision" # content [d37d8e18c4d00c0b17235f81c5021032e163df75] # # add_file "tests/workspace_migration/inodeprints-2/newdir/file3" # content [6cae7599afc389125f786f1d703ef2a9eea08424] # # add_file "tests/workspace_migration/inodeprints-2/renamed-testfile2" # content [535a99a5f65fad210c15c0b969d3aebe33cf405d] # # add_file "tests/workspace_migration/inodeprints-2/testfile1" # content [c01c44cca550f1b77ef5cda76c242e9c03d43cc8] # # add_file "tests/workspace_migration/inodeprints.lua" # content [1e810ab1fa2ffff1e74c05ca4fce226a5098e80b] # # patch "ChangeLog" # from [f56bc8da0290bce97607b0b319b87ea2e3a53976] # to [f9e96bcb4c8ab542d86cf9759887c94cefadbc09] # # patch "tests/workspace_migration/__driver__.lua" # from [76c2af7a10741587b02804a619be6727e6f26228] # to [7bbb0ae37bd598e625f2df0f6e5c11c46364855c] # ============================================================ --- tests/workspace_migration/basic.lua 49dbed3e6b96fb6c0ded16315b5b8aca148595e6 +++ tests/workspace_migration/basic.lua 49dbed3e6b96fb6c0ded16315b5b8aca148595e6 @@ -0,0 +1,33 @@ +---- If you change this code, you will have to regenerate all of the +---- "basic-N" workspaces. + +return { + min_format = 1, + creator = + function () + check(mtn("setup", "-b", "basicbranch", "basic-current")) + chdir("basic-current") + addfile("testfile1", "blah blah\n") + addfile("testfile2", "asdfas dfsa\n") + check(mtn("attr", "set", "testfile1", "test:attr", "fooooo"), + 0, false, false) + + commit("basicbranch") + + -- make some edits to the files + writefile("testfile1", "new stuff\n") + writefile("testfile2", "more new stuff\n") + -- and some tree rearrangement stuff too + check(mtn("rename", "--execute", "testfile2", "renamed-testfile2"), + 0, false, false) + check(mtn("attr", "set", "renamed-testfile2", "test:attr2", "asdf"), + 0, false, false) + check(mtn("attr", "drop", "testfile1", "test:attr"), + 0, false, false) + mkdir("newdir") + writefile("newdir/file3", "twas mimsy and the borogroves\n") + check(mtn("add", "newdir", "newdir/file3"), 0, false, false) + chdir("..") + end, + checker = function (dir, refdir) end +} ============================================================ --- tests/workspace_migration/inodeprints-1/_MTN/inodeprints da39a3ee5e6b4b0d3255bfef95601890afd80709 +++ tests/workspace_migration/inodeprints-1/_MTN/inodeprints da39a3ee5e6b4b0d3255bfef95601890afd80709 ============================================================ --- tests/workspace_migration/inodeprints-1/_MTN/log d3664ada696aa1b7855394a2f7eee66281825adf +++ tests/workspace_migration/inodeprints-1/_MTN/log d3664ada696aa1b7855394a2f7eee66281825adf @@ -0,0 +1 @@ +oh frabjous patch, calloo callay ============================================================ --- tests/workspace_migration/inodeprints-1/_MTN/monotonerc 339d19b34553f03bce2ca334618ac0054a1fdd4e +++ tests/workspace_migration/inodeprints-1/_MTN/monotonerc 339d19b34553f03bce2ca334618ac0054a1fdd4e @@ -0,0 +1 @@ +-- io.stderr:write("warning: bandersnatch insufficiently frumious\n") ============================================================ --- tests/workspace_migration/inodeprints-1/_MTN/options a2a92cf608d8e19dee7ad9ac2c4c1d38e5d6bc76 +++ tests/workspace_migration/inodeprints-1/_MTN/options a2a92cf608d8e19dee7ad9ac2c4c1d38e5d6bc76 @@ -0,0 +1,4 @@ +database "/twas/brillig/and/the/slithy/toves.mtn" + branch "did.gyre.and.gimble.in.the.wabe" + key "address@hidden" + keydir "/and/the/mome/raths/outgrabe" ============================================================ --- tests/workspace_migration/inodeprints-1/_MTN/revision 0b6f95ff1aa3b4d67e10d765254a26d5a37ebef8 +++ tests/workspace_migration/inodeprints-1/_MTN/revision 0b6f95ff1aa3b4d67e10d765254a26d5a37ebef8 @@ -0,0 +1 @@ +c2cdede98d20694daf470055a100bf74fdd8e615 ============================================================ --- tests/workspace_migration/inodeprints-1/_MTN/work 345f6f7bfcc8d889dd158fe912517abae5488389 +++ tests/workspace_migration/inodeprints-1/_MTN/work 345f6f7bfcc8d889dd158fe912517abae5488389 @@ -0,0 +1,14 @@ +rename "testfile2" + to "renamed-testfile2" + +add_dir "newdir" + +add_file "newdir/file3" + content [6cae7599afc389125f786f1d703ef2a9eea08424] + +clear "testfile1" + attr "test:attr" + + set "renamed-testfile2" + attr "test:attr2" +value "asdf" ============================================================ --- tests/workspace_migration/inodeprints-1/newdir/file3 6cae7599afc389125f786f1d703ef2a9eea08424 +++ tests/workspace_migration/inodeprints-1/newdir/file3 6cae7599afc389125f786f1d703ef2a9eea08424 @@ -0,0 +1 @@ +twas mimsy and the borogroves ============================================================ --- tests/workspace_migration/inodeprints-1/renamed-testfile2 535a99a5f65fad210c15c0b969d3aebe33cf405d +++ tests/workspace_migration/inodeprints-1/renamed-testfile2 535a99a5f65fad210c15c0b969d3aebe33cf405d @@ -0,0 +1 @@ +more new stuff ============================================================ --- tests/workspace_migration/inodeprints-1/testfile1 c01c44cca550f1b77ef5cda76c242e9c03d43cc8 +++ tests/workspace_migration/inodeprints-1/testfile1 c01c44cca550f1b77ef5cda76c242e9c03d43cc8 @@ -0,0 +1 @@ +new stuff ============================================================ --- tests/workspace_migration/inodeprints-2/_MTN/format 7448d8798a4380162d4b56f9b452e2f6f9e24e7a +++ tests/workspace_migration/inodeprints-2/_MTN/format 7448d8798a4380162d4b56f9b452e2f6f9e24e7a @@ -0,0 +1 @@ +2 ============================================================ --- tests/workspace_migration/inodeprints-2/_MTN/inodeprints da39a3ee5e6b4b0d3255bfef95601890afd80709 +++ tests/workspace_migration/inodeprints-2/_MTN/inodeprints da39a3ee5e6b4b0d3255bfef95601890afd80709 ============================================================ --- tests/workspace_migration/inodeprints-2/_MTN/log d3664ada696aa1b7855394a2f7eee66281825adf +++ tests/workspace_migration/inodeprints-2/_MTN/log d3664ada696aa1b7855394a2f7eee66281825adf @@ -0,0 +1 @@ +oh frabjous patch, calloo callay ============================================================ --- tests/workspace_migration/inodeprints-2/_MTN/monotonerc 339d19b34553f03bce2ca334618ac0054a1fdd4e +++ tests/workspace_migration/inodeprints-2/_MTN/monotonerc 339d19b34553f03bce2ca334618ac0054a1fdd4e @@ -0,0 +1 @@ +-- io.stderr:write("warning: bandersnatch insufficiently frumious\n") ============================================================ --- tests/workspace_migration/inodeprints-2/_MTN/options a2a92cf608d8e19dee7ad9ac2c4c1d38e5d6bc76 +++ tests/workspace_migration/inodeprints-2/_MTN/options a2a92cf608d8e19dee7ad9ac2c4c1d38e5d6bc76 @@ -0,0 +1,4 @@ +database "/twas/brillig/and/the/slithy/toves.mtn" + branch "did.gyre.and.gimble.in.the.wabe" + key "address@hidden" + keydir "/and/the/mome/raths/outgrabe" ============================================================ --- tests/workspace_migration/inodeprints-2/_MTN/revision d37d8e18c4d00c0b17235f81c5021032e163df75 +++ tests/workspace_migration/inodeprints-2/_MTN/revision d37d8e18c4d00c0b17235f81c5021032e163df75 @@ -0,0 +1,20 @@ +format_version "1" + +new_manifest [9296adf6738af28160271dc44c77c4e3927e17b6] + +old_revision [c2cdede98d20694daf470055a100bf74fdd8e615] + +rename "testfile2" + to "renamed-testfile2" + +add_dir "newdir" + +add_file "newdir/file3" + content [6cae7599afc389125f786f1d703ef2a9eea08424] + +clear "testfile1" + attr "test:attr" + + set "renamed-testfile2" + attr "test:attr2" +value "asdf" ============================================================ --- tests/workspace_migration/inodeprints-2/newdir/file3 6cae7599afc389125f786f1d703ef2a9eea08424 +++ tests/workspace_migration/inodeprints-2/newdir/file3 6cae7599afc389125f786f1d703ef2a9eea08424 @@ -0,0 +1 @@ +twas mimsy and the borogroves ============================================================ --- tests/workspace_migration/inodeprints-2/renamed-testfile2 535a99a5f65fad210c15c0b969d3aebe33cf405d +++ tests/workspace_migration/inodeprints-2/renamed-testfile2 535a99a5f65fad210c15c0b969d3aebe33cf405d @@ -0,0 +1 @@ +more new stuff ============================================================ --- tests/workspace_migration/inodeprints-2/testfile1 c01c44cca550f1b77ef5cda76c242e9c03d43cc8 +++ tests/workspace_migration/inodeprints-2/testfile1 c01c44cca550f1b77ef5cda76c242e9c03d43cc8 @@ -0,0 +1 @@ +new stuff ============================================================ --- tests/workspace_migration/inodeprints.lua 1e810ab1fa2ffff1e74c05ca4fce226a5098e80b +++ tests/workspace_migration/inodeprints.lua 1e810ab1fa2ffff1e74c05ca4fce226a5098e80b @@ -0,0 +1,41 @@ +---- If you change this code, you will have to regenerate all of the +---- "inodeprints-N" workspaces. + +return { + min_format = 1, + creator = + function () + check(mtn("setup", "-b", "inodeprints-branch", "inodeprints-current")) + chdir("inodeprints-current") + writefile("_MTN/inodeprints") + addfile("testfile1", "blah blah\n") + addfile("testfile2", "asdfas dfsa\n") + check(mtn("attr", "set", "testfile1", "test:attr", "fooooo"), + 0, false, false) + + commit("inodeprints-branch") + + -- make some edits to the files + writefile("testfile1", "new stuff\n") + writefile("testfile2", "more new stuff\n") + -- and some tree rearrangement stuff too + check(mtn("rename", "--execute", "testfile2", "renamed-testfile2"), + 0, false, false) + check(mtn("attr", "set", "renamed-testfile2", "test:attr2", "asdf"), + 0, false, false) + check(mtn("attr", "drop", "testfile1", "test:attr"), + 0, false, false) + mkdir("newdir") + writefile("newdir/file3", "twas mimsy and the borogroves\n") + check(mtn("add", "newdir", "newdir/file3"), 0, false, false) + check(mtn("refresh_inodeprints")) + chdir("..") + end, + checker = + function (dir, refdir) + -- We can't actually test that the inodeprints file came through + -- intact, because its content is unpredictable. Just make sure + -- it still exists. + check(exists(dir .. "/_MTN/inodeprints")) + end +} ============================================================ --- ChangeLog f56bc8da0290bce97607b0b319b87ea2e3a53976 +++ ChangeLog f9e96bcb4c8ab542d86cf9759887c94cefadbc09 @@ -1,5 +1,8 @@ 2007-02-09 Zack Weinberg
+ * tests/workspace_migration: Generalize to support different sorts + of migration-needing workspaces. + * cmd_list.cc (ls_known, ls_changed): Work in a two-parent workspace. * tests/two_parent_workspace_list: New test. * testsuite.lua: Add it. ============================================================ --- tests/workspace_migration/__driver__.lua 76c2af7a10741587b02804a619be6727e6f26228 +++ tests/workspace_migration/__driver__.lua 7bbb0ae37bd598e625f2df0f6e5c11c46364855c @@ -6,91 +6,68 @@ -- a new piece to this test, for the new format. The way you do this is to -- run this test with the -d option, like so: -- $ ./testsuite.lua -d workspace_migration --- this will cause the test to leave behind its temporary files. You want --- tester_dir/workspace_migration/current/ --- copy that directory to this directory, named test-