# # # patch "cmd_ws_commit.cc" # from [68a237875400db79f3e83844acedb021e0958ad9] # to [921b7094e71b5acd6d3f88906ec90c765d7eba85] # # patch "tests/checkout_creates_right__MTN_options/__driver__.lua" # from [96e523c6d38b613a00babbcfa0541d97fca816a1] # to [affd49ec20b64f206fbf10807a5ccdfe02c8e9cd] # # patch "tests/checkout_does_not_clobber_workspace/__driver__.lua" # from [6da54aaa4a77b6e624ea745dbdfcdba14cba139d] # to [818f0428f38c06106487a9f1d22a963590f045f7] # ============================================================ --- cmd_ws_commit.cc 68a237875400db79f3e83844acedb021e0958ad9 +++ cmd_ws_commit.cc 921b7094e71b5acd6d3f88906ec90c765d7eba85 @@ -603,12 +603,12 @@ CMD(status, "status", "", CMD_REF(inform cout << summary_external; } -CMD(checkout, "checkout", "co", CMD_REF(tree), N_("[DIRECTORY]"), - N_("Checks out a revision from the database into a directory"), - N_("If a revision is given, that's the one that will be checked out. " - "Otherwise, it will be the head of the branch (given or implicit). " - "If no directory is given, the branch name will be used as directory."), - options::opts::branch | options::opts::revision) +CMD_NO_WORKSPACE(checkout, "checkout", "co", CMD_REF(tree), N_("[DIRECTORY]"), + N_("Checks out a revision from the database into a directory"), + N_("If a revision is given, that's the one that will be checked out. " + "Otherwise, it will be the head of the branch (given or implicit). " + "If no directory is given, the branch name will be used as directory."), + options::opts::branch | options::opts::revision) { revision_id revid; system_path dir; ============================================================ --- tests/checkout_creates_right__MTN_options/__driver__.lua 96e523c6d38b613a00babbcfa0541d97fca816a1 +++ tests/checkout_creates_right__MTN_options/__driver__.lua affd49ec20b64f206fbf10807a5ccdfe02c8e9cd @@ -8,25 +8,17 @@ rev = base_revision() -- We use RAW_MTN because it used to be that passing --db= (as -- MTN does) would hide a bug in this functionality... --- all of these inherit options settings from the current _MTN dir --- unless they override them on the command line +check(raw_mtn("--db=test.db", "--branch=testbranch", "checkout", "test_dir1"), 0, false, false) +check(raw_mtn("--db=test.db", "--branch=testbranch", "checkout", "--revision", rev, "test_dir2"), 0, false, false) +check(raw_mtn("--db=test.db", "checkout", "--revision", rev, "test_dir3"), 0, false, false) -check(raw_mtn("checkout", "test_dir1"), 0, false, false) -check(raw_mtn("--db=test.db", "checkout", "test_dir2"), 0, false, false) -check(raw_mtn("--db=test.db", "--branch=testbranch", "checkout", "test_dir3"), 0, false, false) -check(raw_mtn("--branch=testbranch", "checkout", "test_dir4"), 0, false, false) -check(raw_mtn("--db=test.db", "--branch=testbranch", "checkout", "--revision", rev, "test_dir5"), 0, false, false) -check(raw_mtn("--branch=testbranch", "checkout", "--revision", rev, "test_dir6"), 0, false, false) -check(raw_mtn("--db=test.db", "checkout", "--revision", rev, "test_dir7"), 0, false, false) -check(raw_mtn("checkout", "--revision", rev, "test_dir8"), 0, false, false) - -- checkout fails if the specified revision is not a member of the specified branch -check(raw_mtn("--branch=foobar", "checkout", "--revision", rev, "test_dir9"), 1, false, false) +check(raw_mtn("--db=test.db", "--branch=foobar", "checkout", "--revision", rev, "test_dir4"), 1, false, false) check(mtn("cert", rev, "branch", "foobar"), 0, false, false) -check(raw_mtn("--branch=foobar", "checkout", "--revision", rev, "test_dir10"), 0, false, false) +check(raw_mtn("--db=test.db", "--branch=foobar", "checkout", "--revision", rev, "test_dir5"), 0, false, false) -for i = 1,8 do +for i = 1,3 do local dir = "test_dir"..i L("dir = ", dir, "\n") check(exists(dir.."/_MTN/options")) @@ -34,4 +26,4 @@ end check(qgrep("testbranch", dir.."/_MTN/options")) end -check(qgrep("foobar", "test_dir10/_MTN/options")) +check(qgrep("foobar", "test_dir5/_MTN/options")) ============================================================ --- tests/checkout_does_not_clobber_workspace/__driver__.lua 6da54aaa4a77b6e624ea745dbdfcdba14cba139d +++ tests/checkout_does_not_clobber_workspace/__driver__.lua 818f0428f38c06106487a9f1d22a963590f045f7 @@ -7,7 +7,7 @@ mkdir("test1") -- checkout to clean workspace mkdir("test1") -check(indir("test1", mtn("checkout", "."))) +check(indir("test1", raw_mtn("checkout", "--db=../test.db", "--branch=testbranch", "."))) -- checkout to workspace with an unversioned file blocking a versioned file mkdir("test2")