# # patch "ChangeLog" # from [dabaf521855697e3621527d7a6663b65e866cda4] # to [c052000953d4ac37c4e2d987d241bfe8c4acd0e1] # # patch "commands.cc" # from [1d3ffb053901c8cbdaae7aab407b213c5f2c9707] # to [627f94732bd7bd2886d9688dab916bb203b8ed77] # # patch "tests/t_add_stomp_file.at" # from [77c4431e1c15af16e1375d4c0fc433007baa1fb8] # to [5bbd2eb4c43a8400477107da7c242e63596650b3] # # patch "tests/t_add_vs_commit.at" # from [7fd4b57e97609427e699e0cf3cca5c984ffd1330] # to [92280abe24d27ced1ce60d8b8e87efc310be4550] # # patch "tests/t_annotate.at" # from [c41984b9c72ac6a45393a06dfba8f56dd910bf21] # to [d216df41c2dc211585a5d317cc31263651e47fa6] # # patch "tests/t_lf_crlf.at" # from [6320cbf9fb0416ac32b1a3627ff87ddd0903dded] # to [957aa1c817b7e7b23414ad3e45f0379f8afa0821] # # patch "tests/t_update_nonexistent.at" # from [a7f5255b645f8be25c40d15a62f9f5279bf2aa59] # to [045eadf406dd46aa126cc91b318006098e76002e] # # patch "tests/t_update_off_branch.at" # from [098a2d92e488117572fdd96112cc29d95e712c7e] # to [1ce8c8ecbb87f94254f0c7090d738273f4812b44] # # patch "tests/t_update_to_revision.at" # from [e97fda6d61ea056ad72a290d7b580b79f0177eda] # to [a8a0f7025381a5e14f3c650d14c1d21ade3cd589] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,19 @@ +2005-05-30 Richard Levitte + + * commands.cc (CMD(checkout), CMD(cdiff), CMD(diff), CMD(log)): + Remove '[--revision=REVISION]' from command argument synopsis, + and add more text to the help to explain what happens when + --revision options are used. + (CMD(update)): Instead of the optional revision argument, use + the --revision option. Add information on what happens when the + --revision option is used, and when it's not. + + * tests/t_add_stomp_file.at, tests/t_add_vs_commit.at, + tests/t_annotate.at, tests/t_lf_crlf.at, + tests/t_update_nonexistent.at, tests/t_update_off_branch.at, + tests/t_update_to_revision.at: Update to use --revision with + 'monotone update'. + 2005-05-29 Timothy Brownawell * contrib/monoprof.sh: Add support for using valgrind for --- commands.cc +++ commands.cc @@ -1255,7 +1255,8 @@ } -CMD(status, "informative", "[PATH]...", "show status of working copy", OPT_DEPTH) +CMD(status, "informative", "[PATH]...", "show status of working copy", + OPT_DEPTH) { revision_set rs; manifest_map m_old, m_new; @@ -1396,8 +1397,11 @@ } -CMD(checkout, "tree", "[--revision=REVISION] [DIRECTORY]\n", - "check out revision from database into directory", +CMD(checkout, "tree", "[DIRECTORY]\n", + "check out revision from database into directory.\n" + "If a revision is given, that's the one that will be checked out.\n" + "Otherwise, it will be the head of the branch (given or implicit).\n" + "If no directory is given, the branch name will be used as directory", OPT_BRANCH_NAME % OPT_REVISION) { revision_id ident; @@ -2670,15 +2674,21 @@ dump_diffs(composite.deltas, app, new_is_archived, type); } -CMD(cdiff, "informative", "[--revision=REVISION [--revision=REVISION]] [PATH]...", - "show current context diffs on stdout", +CMD(cdiff, "informative", "[PATH]...", + "show current context diffs on stdout.\n" + "If one revision is given, the diff between the working directory and\n" + "that revision is shown. If two revisions are given, the diff between\n" + "them is given.", OPT_BRANCH_NAME % OPT_REVISION) { do_diff(name, app, args, context_diff); } -CMD(diff, "informative", "[--revision=REVISION [--revision=REVISION]] [PATH]...", - "show current unified diffs on stdout", +CMD(diff, "informative", "[PATH]...", + "show current unified diffs on stdout.\n" + "If one revision is given, the diff between the working directory and\n" + "that revision is shown. If two revisions are given, the diff between\n" + "them is given.", OPT_BRANCH_NAME % OPT_REVISION % OPT_DEPTH) { do_diff(name, app, args, unified_diff); @@ -2825,8 +2835,11 @@ // cout << "change set '" << name << "'\n" << dat << endl; // } -CMD(update, "working copy", "[REVISION]", "update working copy to be based off another revision", - OPT_BRANCH_NAME) +CMD(update, "working copy", "", + "update working copy.\n" + "If a revision is given, base the update on that revision. If not,\n" + "base the update on the head of the branch (given or implicit).", + OPT_BRANCH_NAME % OPT_REVISION) { manifest_map m_old, m_ancestor, m_working, m_chosen; manifest_id m_ancestor_id, m_chosen_id; @@ -2834,9 +2847,12 @@ revision_id r_old_id, r_chosen_id; change_set old_to_chosen, update; - if (args.size() != 0 && args.size() != 1) + if (args.size() > 0) throw usage(name); + if (app.revision_selectors.size() > 0) + throw usage(name); + if (!app.branch_name().empty()) app.make_branch_sticky(); app.require_working_copy(); @@ -2849,7 +2865,7 @@ N(!null_id(r_old_id), F("this working directory is a new project; cannot update")); - if (args.size() == 0) + if (app.revision_selectors.size() == 0) { set candidates; pick_update_candidates(r_old_id, app, candidates); @@ -2868,7 +2884,7 @@ } else { - complete(app, idx(args, 0)(), r_chosen_id); + complete(app, app.revision_selectors[0](), r_chosen_id); N(app.db.revision_exists(r_chosen_id), F("no revision %s found in database") % r_chosen_id); } @@ -3491,9 +3507,9 @@ do_annotate(app, file, fid, rid); } -CMD(log, "informative", "[file] [--revision=REVISION [--revision=REVISION [...]]]", - "print history in reverse order (filtering by 'file'). If one or more revisions\n" - "are given, use them as a starting point.", +CMD(log, "informative", "[FILE]", + "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_REVISION % OPT_BRIEF) { file_path file; --- tests/t_add_stomp_file.at +++ tests/t_add_stomp_file.at @@ -38,7 +38,7 @@ REV=`BASE_REVISION` # Alice does her update, discovers foo has been stomped! -AT_CHECK( (cd alicewd; MONOTONE --branch=testbranch --root=. update $REV), [], [ignore], [ignore]) +AT_CHECK( (cd alicewd; MONOTONE --branch=testbranch --root=. update --revision=$REV), [], [ignore], [ignore]) AT_CHECK(cmp foo.alice alicewd/foo) AT_CLEANUP --- tests/t_add_vs_commit.at +++ tests/t_add_vs_commit.at @@ -41,7 +41,7 @@ REV=`BASE_REVISION` # Alice does her update, then attempts, eg., a diff -AT_CHECK( (cd alicewd; MONOTONE --root=. update $REV), [], [ignore], [ignore]) +AT_CHECK( (cd alicewd; MONOTONE --root=. update --revision=$REV), [], [ignore], [ignore]) AT_CHECK( (cd alicewd; MONOTONE --root=. diff), [], [ignore], [ignore]) AT_CLEANUP --- tests/t_annotate.at +++ tests/t_annotate.at @@ -121,7 +121,7 @@ REV6=`BASE_REVISION` # Now make right side -AT_CHECK(MONOTONE update $REV4, [], [ignore], [ignore]) +AT_CHECK(MONOTONE update --revision=$REV4, [], [ignore], [ignore]) AT_DATA(bar0, [bar on right side of fork ]) --- tests/t_lf_crlf.at +++ tests/t_lf_crlf.at @@ -30,7 +30,7 @@ AT_CHECK(MONOTONE --rcfile=linesep.lua commit -m foofoo, [], [ignore], [ignore]) FOO_FOO_REV=`BASE_REVISION` -AT_CHECK(MONOTONE --rcfile=linesep.lua update $FOO_REV, [], [ignore], [ignore]) +AT_CHECK(MONOTONE --rcfile=linesep.lua update --revision=$FOO_REV, [], [ignore], [ignore]) AT_CHECK(cmp foo foo.crlf, [], [ignore], [ignore]) AT_CHECK(MONOTONE --rcfile=linesep.lua checkout --revision=$FOO_REV foo_crlf, [], [ignore], [ignore]) --- tests/t_update_nonexistent.at +++ tests/t_update_nonexistent.at @@ -5,6 +5,6 @@ ]) COMMIT(testbranch) -AT_CHECK(MONOTONE update 73070030f7b0d0f3d4ee02545d45ca4bbe5e189f, [1], [ignore], [ignore]) +AT_CHECK(MONOTONE update --revision=73070030f7b0d0f3d4ee02545d45ca4bbe5e189f, [1], [ignore], [ignore]) AT_CLEANUP --- tests/t_update_off_branch.at +++ tests/t_update_off_branch.at @@ -12,7 +12,7 @@ OR=`BASE_REVISION` AT_CHECK(MONOTONE checkout --branch=testbranch --revision=$TR codir, [], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE update $OR, [1], [ignore], [ignore]) -AT_CHECK(cd codir && MONOTONE update --branch=otherbranch $OR, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE update --revision=$OR, [1], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE update --branch=otherbranch --revision=$OR, [], [ignore], [ignore]) AT_CLEANUP --- tests/t_update_to_revision.at +++ tests/t_update_to_revision.at @@ -54,12 +54,12 @@ LEFT_LEAF_R_SHA=`BASE_REVISION` # Test going backward in the revision tree. -AT_CHECK(MONOTONE update $ROOT_R_SHA, [], [ignore], [ignore]) +AT_CHECK(MONOTONE update --revision=$ROOT_R_SHA, [], [ignore], [ignore]) diff -u testfile root AT_CHECK(cmp testfile root, [], [ignore]) # Test going forward in the revision tree. -AT_CHECK(MONOTONE update $MIDDLE_R_SHA, [], [ignore], [ignore]) +AT_CHECK(MONOTONE update --revision=$MIDDLE_R_SHA, [], [ignore], [ignore]) AT_CHECK(cmp testfile middle, [], [ignore]) # Create a fork from middle. @@ -68,12 +68,12 @@ RIGHT_LEAF_R_SHA=`BASE_REVISION` # Test going from the right left to the left leaf via the common ancestor. -AT_CHECK(MONOTONE update $LEFT_LEAF_R_SHA, [], [ignore], [ignore]) +AT_CHECK(MONOTONE update --revision=$LEFT_LEAF_R_SHA, [], [ignore], [ignore]) AT_CHECK(cmp testfile left-leaf, [], [ignore]) # Test that working copy changes are kept while going backward. AT_CHECK(cp modified-left-leaf testfile) -AT_CHECK(MONOTONE update $ROOT_R_SHA, [], [ignore], [ignore]) +AT_CHECK(MONOTONE update --revision=$ROOT_R_SHA, [], [ignore], [ignore]) AT_CHECK(cmp testfile modified-root, [], [ignore]) AT_CLEANUP