# # # patch "ChangeLog" # from [da16203bf553664dc08c469b5aeb357c84957981] # to [83870fe15a60a7c182b6b76f8a88e43374d28fad] # # patch "commands.cc" # from [05fef6fd462f342c74beaca773dafb07464cc62e] # to [1758c532e79b10df0c45c1108b436b128825ba10] # # patch "tests/t_add_dot.at" # from [70227719dce0b158824f846a8f7a529a7f85dced] # to [39fd728b6928219f57a29721dcb562678b268806] # # patch "tests/t_automate_inventory.at" # from [109af5a233e8700e3d11694aefc5f03ddc84107e] # to [951b4d10718b57612199f794f28308933d747147] # # patch "tests/t_rename.at" # from [4ec762efe273f44b4a63dcc27cb9c40b0af312b4] # to [b1b9ab47f0034373ed27f12518b319d81a7f4370] # # patch "tests/t_revert.at" # from [e6f8b570d747a39a35865d3d072e4d34e72b86f1] # to [e21976b842ae9dedab8a25e085799937c11edaa8] # # patch "tests/t_revert_restrict.at" # from [f6d1a1494daed11b4166446d584c2a13ce1622b6] # to [65eb2a485e893c21a9043e08e6c62e116cd4571d] # ============================================================ --- ChangeLog da16203bf553664dc08c469b5aeb357c84957981 +++ ChangeLog 83870fe15a60a7c182b6b76f8a88e43374d28fad @@ -1,3 +1,8 @@ +2005-12-26 Matt Johnston + + * commands.cc (CMD(revert)): revert with no args prints usage, + mention "." for entire working copy. + 2005-12-21 Matt Johnston * commands.cc (dump_difs, CMD(log)): only print --diffs for the file ============================================================ --- commands.cc 05fef6fd462f342c74beaca773dafb07464cc62e +++ commands.cc 1758c532e79b10df0c45c1108b436b128825ba10 @@ -3417,13 +3417,16 @@ CMD(revert, N_("working copy"), N_("[PATH]..."), - N_("revert file(s), dir(s) or entire working copy"), OPT_DEPTH % OPT_EXCLUDE % OPT_MISSING) + N_("revert file(s), dir(s) or entire working copy (\".\")"), OPT_DEPTH % OPT_EXCLUDE % OPT_MISSING) { manifest_map m_old; revision_id old_revision_id; manifest_id old_manifest_id; change_set::path_rearrangement work, included, excluded; path_set old_paths; + + if (args.size() < 1) + throw usage(name); app.require_working_copy(); ============================================================ --- tests/t_add_dot.at 70227719dce0b158824f846a8f7a529a7f85dced +++ tests/t_add_dot.at 39fd728b6928219f57a29721dcb562678b268806 @@ -24,7 +24,7 @@ AT_CHECK(rm subdir/testfile1) AT_CHECK(rm subdir/testfile2) AT_CHECK(rm -r subdir/testdir1) -AT_CHECK(cd subdir && MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(cd subdir && MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(test -f subdir/testfile1) AT_CHECK(test -f subdir/testfile2) ============================================================ --- tests/t_automate_inventory.at 109af5a233e8700e3d11694aefc5f03ddc84107e +++ tests/t_automate_inventory.at 951b4d10718b57612199f794f28308933d747147 @@ -55,7 +55,7 @@ # swapped but not moved -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE rename unchanged temporary, [], [ignore], [ignore]) AT_CHECK(MONOTONE rename original unchanged, [], [ignore], [ignore]) @@ -77,7 +77,7 @@ # rename foo bar; add foo -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE rename original renamed, [], [ignore], [ignore]) AT_CHECK(MONOTONE add original, [], [ignore], [ignore]) @@ -90,7 +90,7 @@ # - note that things are listed and numbered in path collating order # dropped -> missing -> original -> dropped -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE rename original temporary, [], [ignore], [ignore]) AT_CHECK(MONOTONE rename missing original, [], [ignore], [ignore]) @@ -116,7 +116,7 @@ # dropped but not removed and thus unknown -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE drop dropped, [], [ignore], [ignore]) @@ -125,7 +125,7 @@ # added but removed and thus missing -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE add added, [], [ignore], [ignore]) AT_CHECK(rm added, [], [ignore], [ignore]) @@ -135,7 +135,7 @@ # renamed but not moved and thus unknown source and missing target -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(rm renamed) AT_CHECK(MONOTONE rename original renamed, [], [ignore], [ignore]) @@ -146,7 +146,7 @@ # moved but not renamed and thus missing source and unknown target -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(mv original renamed, [], [ignore], [ignore]) @@ -156,7 +156,7 @@ # renamed and patched -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_DATA(renamed, [renamed and patched ]) ============================================================ --- tests/t_rename.at 4ec762efe273f44b4a63dcc27cb9c40b0af312b4 +++ tests/t_rename.at b1b9ab47f0034373ed27f12518b319d81a7f4370 @@ -58,7 +58,7 @@ # move file to wrong place before renaming it AT_CHECK(mv barfoo bar) -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE status, [], [ignore], [ignore]) AT_CHECK(mv bar barfoofoo) AT_CHECK(MONOTONE rename bar barfoo, [], [ignore], [stderr]) ============================================================ --- tests/t_revert.at e6f8b570d747a39a35865d3d072e4d34e72b86f1 +++ tests/t_revert.at e21976b842ae9dedab8a25e085799937c11edaa8 @@ -29,7 +29,7 @@ ]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(grep testfile0 stdout, [0], [ignore]) -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(test ! -e MT/work, [], [ignore]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(grep testfile0 stdout, [1], [ignore]) @@ -41,7 +41,7 @@ AT_CHECK(grep testfile0 MT/work, [0], [ignore]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(grep testfile0 stdout, [0], [ignore]) -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(test ! -e MT/work, [], [ignore]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(grep testfile0 stdout, [1], [ignore]) @@ -69,7 +69,7 @@ AT_CHECK(grep testfile1 MT/work, [0], [ignore]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(grep testfile1 stdout, [0], [ignore]) -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(test ! -e MT/work, [], [ignore]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(grep testfile1 stdout, [1], [ignore]) @@ -99,7 +99,7 @@ AT_CHECK(grep sub stdout, [1], [ignore]) # check reverting a missing file -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(rm testfile0) AT_CHECK(MONOTONE status, [1], [ignore], [ignore]) AT_CHECK(MONOTONE revert testfile0, [], [stdout], [ignore]) @@ -107,7 +107,7 @@ # check reverting some changes and leaving others -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(MONOTONE status, [], [stdout]) AT_CHECK(cp testfile0 foofile0, []) @@ -133,4 +133,11 @@ AT_CHECK(grep foofile2 stdout, [1], [ignore]) AT_CHECK(test ! -e MT/work, [], [ignore]) +# check that "revert" by itself just prints usage. +AT_CHECK(echo blah > foofile0, []) +V1=`SHA1(foofile0)` +AT_CHECK(MONOTONE revert, [2], [ignore], [ignore]) +V2=`SHA1(foofile0)` +AT_CHECK(test $V1 = $V2) + AT_CLEANUP ============================================================ --- tests/t_revert_restrict.at f6d1a1494daed11b4166446d584c2a13ce1622b6 +++ tests/t_revert_restrict.at 65eb2a485e893c21a9043e08e6c62e116cd4571d @@ -43,7 +43,7 @@ AT_CHECK(cmp file.ignore orig.ignore, [0], [ignore], [ignore]) # now run it again with two paths, one in the ignorehook list, the other normal -AT_CHECK(MONOTONE revert, [], [ignore], [ignore]) +AT_CHECK(MONOTONE revert ., [], [ignore], [ignore]) AT_CHECK(cp modified1 testfile) AT_CHECK(cp modified2 file.ignore) AT_CHECK(cp modified3 file2) @@ -62,7 +62,7 @@ AT_CHECK(cp modified2 file.ignore) AT_CHECK(rm file2) -AT_CHECK(MONOTONE --rcfile=ignore_hook.lua revert --missing --debug, [], [ignore], [ignore]) +AT_CHECK(MONOTONE --rcfile=ignore_hook.lua revert . --missing --debug, [], [ignore], [ignore]) AT_CHECK(cmp testfile modified1, [0], [ignore], [ignore]) AT_CHECK(cmp file.ignore modified2, [0], [ignore], [ignore]) @@ -76,7 +76,7 @@ AT_CHECK(cp orig.ignore file.ignore) AT_CHECK(cp orig2 file2) -AT_CHECK(MONOTONE --rcfile=ignore_hook.lua revert --missing --debug, [], [ignore], [ignore]) +AT_CHECK(MONOTONE --rcfile=ignore_hook.lua revert . --missing --debug, [], [ignore], [ignore]) AT_CHECK(cmp testfile modified1, [0], [ignore], [ignore]) AT_CHECK(cmp file.ignore orig.ignore, [0], [ignore], [ignore])