# # add_file "tests/t_log_depth_single.at" # # patch "ChangeLog" # from [ae2e02da5c19b3d5d64b665d07246f9f3a3a20ef] # to [58b6bfb75b91abb859ba3f386749c96f5a3b59db] # # patch "commands.cc" # from [f799f34e8ba194fd418814d33f666566a27e8a17] # to [03f2629a705353d58d44a262df5dad90ae742406] # # patch "tests/t_log_depth_single.at" # from [] # to [3fe186f050476a690094a1573b22eea463f9ee41] # # patch "testsuite.at" # from [78e75421c02747bc50d1966394370014a1e16858] # to [5a4b44789f673d97f373ddb22a5dcc4be991cdce] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,10 @@ +2005-04-19 Matthew Gregan + + * commands.cc (log): 'depth' option did not handle the single file + case correctly. Also a couple of minor cleanups. + * tests/t_log_depth_single.at: New test. + * testsuite.at: Add test. + 2005-04-18 Matthew Gregan * commands.cc (string_to_datetime): Fix warning. --- commands.cc +++ commands.cc @@ -3726,7 +3726,7 @@ if (args.size() == 2) { complete(app, idx(args, 0)(), rid); - file=file_path(idx(args, 1)()); + file = file_path(idx(args, 1)()); } else if (args.size() == 1) { @@ -3740,7 +3740,6 @@ { app.require_working_copy(); // no id arg, must have working copy - file=file_path(arg); file = file_path(arg); get_revision_id(rid); } @@ -3850,13 +3849,14 @@ log_certs(app, rid, changelog_name, "ChangeLog: ", true); log_certs(app, rid, comment_name, "Comments: ", true); + + if (depth > 0) + { + depth--; + } } } frontier = next_frontier; - if (depth > 0) - { - depth--; - } } } --- tests/t_log_depth_single.at +++ tests/t_log_depth_single.at @@ -0,0 +1,22 @@ +AT_SETUP([only log a few entries instead of the whole log (single file)]) +MONOTONE_SETUP + +ADD_FILE(foo, [foo +]) +AT_CHECK(MONOTONE --branch=testbranch commit --message "Addition of foo.", + [], [ignore], [ignore]) + +ADD_FILE(bar, [bar +]) +AT_CHECK(MONOTONE --branch=testbranch commit --message "Addition of bar.", + [], [ignore], [ignore]) + +ADD_FILE(baz, [baz +]) +AT_CHECK(MONOTONE --branch=testbranch commit --message "Addition of baz.", + [], [ignore], [ignore]) + +AT_CHECK(MONOTONE log --depth=1 foo | grep '^Revision:', [], [stdout], [ignore]) +AT_CHECK(test 1 -eq "`wc -l