# # # add_file "tests/t_approve.at" # content [c7d4a122fb6bcef383c1f0789a881139908377ad] # # add_file "tests/t_help.at" # content [0cdc7960a85e968a18585462d2ce8592293d8ba7] # # patch "ChangeLog" # from [8f20240eb43d154d98ed0e1ee40538887f03fefb] # to [27f67dd7fe83cb20eedbe51b09e3290d12472363] # # patch "commands.cc" # from [52541d8a7684f14ec39abdec419e70f68e326293] # to [de07658f84b0fb5c5c31cbf24edcd2adb7f836b6] # # patch "tests/t_log_dir.at" # from [558f951c51a142ec83d5819ab1b404f5252621a4] # to [3893759bde1b1af1ad07dcf4cddb61e90f928924] # # patch "testsuite.at" # from [1d542b89c1cc4e708d6dfa8c593e3ce0b9c1f92f] # to [09acd2ba56b82b51e518d709f08d9fd4033a2884] # ============================================================ --- tests/t_approve.at c7d4a122fb6bcef383c1f0789a881139908377ad +++ tests/t_approve.at c7d4a122fb6bcef383c1f0789a881139908377ad @@ -0,0 +1,12 @@ +AT_SETUP([test the approve command]) +MTN_SETUP + +ADD_FILE(foo, [bar +]) +COMMIT(testbranch) +AT_CHECK((echo address@hidden; echo address@hidden) | MTN genkey address@hidden, [], [ignore], [ignore]) +AT_CHECK(MTN approve -k address@hidden `BASE_REVISION`, [], [ignore], [ignore]) +AT_CHECK(MTN ls certs `BASE_REVISION`, [], [stdout], [ignore]) +AT_CHECK(grep address@hidden stdout, [0], [ignore], [ignore]) + +AT_CLEANUP ============================================================ --- tests/t_help.at 0cdc7960a85e968a18585462d2ce8592293d8ba7 +++ tests/t_help.at 0cdc7960a85e968a18585462d2ce8592293d8ba7 @@ -0,0 +1,9 @@ +AT_SETUP([test the help command]) +MTN_SETUP + +AT_CHECK(MTN help mv, [2], [stdout], []) +AT_CHECK(mv stdout out, [], [], []) +AT_CHECK(MTN --help mv, [2], [stdout], []) +AT_CHECK(cmp out stdout, [], [ignore], [ignore]) + +AT_CLEANUP ============================================================ --- ChangeLog 8f20240eb43d154d98ed0e1ee40538887f03fefb +++ ChangeLog 27f67dd7fe83cb20eedbe51b09e3290d12472363 @@ -1,3 +1,12 @@ +2006-04-19 Timtohy Brownawell + + * commands.cc (log): Make log accept --recursive, which makes + "log dir" log revisions where anything under dir/ changes. + * tests/t_log_dir.at: Remove XFAIL. Test logging at attr change. + * tests/t_help.at: New file, test the "help" command. + * tests/t_approve.at: New file, test the "approve" command. + * testsuite.at: Add the new tests. + 2006-04-19 Matthew Gregan * tests/t_mtn_ignore.at: Tweak test so it would have detected the ============================================================ --- commands.cc 52541d8a7684f14ec39abdec419e70f68e326293 +++ commands.cc de07658f84b0fb5c5c31cbf24edcd2adb7f836b6 @@ -3659,7 +3659,7 @@ N_("print history in reverse order (filtering by 'FILE'). If one or more\n" "revisions are given, use them as a starting point."), OPT_LAST % OPT_NEXT % OPT_REVISION % OPT_BRIEF % OPT_DIFFS % OPT_NO_MERGES % - OPT_NO_FILES) + OPT_NO_FILES % OPT_RECURSIVE) { if (app.revision_selectors.size() == 0) app.require_workspace("try passing a --revision to start at"); @@ -3700,6 +3700,7 @@ else app.db.get_roster(first_rid, new_roster); + deque todo; for (size_t i = 0; i < args.size(); ++i) { file_path fp = file_path_external(idx(args, i)); @@ -3707,8 +3708,23 @@ fp.split(sp); N(new_roster.has_node(sp), F("Unknown file '%s' for log command") % fp); - nodes.insert(new_roster.get_node(sp)->self); + todo.push_back(new_roster.get_node(sp)); } + while (!todo.empty()) + { + node_t n = todo.front(); + todo.pop_front(); + nodes.insert(n->self); + if (app.recursive && is_dir_t(n)) + { + dir_t d = downcast_to_dir_t(n); + for (dir_map::const_iterator i = d->children.begin(); + i != d->children.end(); ++i) + { + todo.push_front(i->second); + } + } + } } ============================================================ --- tests/t_log_dir.at 558f951c51a142ec83d5819ab1b404f5252621a4 +++ tests/t_log_dir.at 3893759bde1b1af1ad07dcf4cddb61e90f928924 @@ -1,11 +1,12 @@ AT_SETUP([log dir]) MTN_SETUP # This test is a bug report -# log dir should only list revisions which change the things in or below dir +# log dir -R should only list revisions which change the things in or below dir +# log dir should only list revisions which change dir (note that this does not +# include things that change "ls dir", but only add/drop/rename/attr set on +# the dir itself) -AT_XFAIL_IF(true) - ADD_FILE(foo, [foo ]) ADD_FILE(bar, [bar @@ -51,6 +52,10 @@ COMMIT(testbranch) REV6=`BASE_REVISION` +AT_CHECK(MTN attr set dir2/ myattr myval, [], [ignore], [ignore]) +COMMIT(testbranch) +REV7=`BASE_REVISION` + # commented out tests below currently fail but they *should* pass (I think) AT_CHECK(MTN log, [], [stdout], [ignore]) @@ -61,17 +66,29 @@ AT_CHECK(grep "^Revision: $REV4" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV5" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV6" stdout, [0], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV7" stdout, [0], [ignore], [ignore]) AT_CHECK(MTN log ., [], [stdout], [ignore]) AT_CHECK(grep "^Revision: $REV1" stdout, [0], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV2" stdout, [1], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV3" stdout, [1], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV4" stdout, [1], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV5" stdout, [1], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV6" stdout, [1], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV7" stdout, [1], [ignore], [ignore]) + +AT_CHECK(MTN log . -R, [], [stdout], [ignore]) + +AT_CHECK(grep "^Revision: $REV1" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV2" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV3" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV4" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV5" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV6" stdout, [0], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV7" stdout, [0], [ignore], [ignore]) -AT_CHECK(MTN log dir1, [], [stdout], [ignore]) +AT_CHECK(MTN log dir1 -R, [], [stdout], [ignore]) AT_CHECK(grep "^Revision: $REV1" stdout, [1], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV2" stdout, [0], [ignore], [ignore]) @@ -79,8 +96,9 @@ AT_CHECK(grep "^Revision: $REV4" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV5" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV6" stdout, [1], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV7" stdout, [1], [ignore], [ignore]) -AT_CHECK(MTN log dir2, [], [stdout], [ignore]) +AT_CHECK(MTN log dir2 -R, [], [stdout], [ignore]) AT_CHECK(grep "^Revision: $REV1" stdout, [1], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV2" stdout, [1], [ignore], [ignore]) @@ -88,5 +106,6 @@ AT_CHECK(grep "^Revision: $REV4" stdout, [0], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV5" stdout, [1], [ignore], [ignore]) AT_CHECK(grep "^Revision: $REV6" stdout, [0], [ignore], [ignore]) +AT_CHECK(grep "^Revision: $REV7" stdout, [0], [ignore], [ignore]) AT_CLEANUP ============================================================ --- testsuite.at 1d542b89c1cc4e708d6dfa8c593e3ce0b9c1f92f +++ testsuite.at 09acd2ba56b82b51e518d709f08d9fd4033a2884 @@ -875,3 +875,5 @@ m4_include(tests/t_pidfile_log_permissions.at) m4_include(tests/t_executable_umask.at) m4_include(tests/t_setup_workspace_in_workspace.at) +m4_include(tests/t_help.at) +m4_include(tests/t_approve.at)