# # patch "ChangeLog" # from [a5dafa1ffb333c3848b1bccb92f51ce60673ddb0] # to [5387993cd1182600f3f4459588e89af64f7feb59] # # patch "commands.cc" # from [a30b0c61b1635b2a61b130e9485d591a6882aefd] # to [3176e0a5397306096cf3ad3da067252881ddb413] # # patch "tests/t_checkout_dir.at" # from [98e7c88da741590079b68cbbf44041a628315739] # to [f300f105573d0ec40486eaeae660a6a782442961] # ======================================================================== --- ChangeLog a5dafa1ffb333c3848b1bccb92f51ce60673ddb0 +++ ChangeLog 5387993cd1182600f3f4459588e89af64f7feb59 @@ -1,3 +1,8 @@ +2005-08-27 Nathaniel Smith + + * commands.cc (checkout): Special-case "checkout ." + * tests/t_checkout_dir.at: Test it. + 2005-08-26 Nathaniel Smith * file_io.hh: Remove comment describing old path types. ======================================================================== --- commands.cc a30b0c61b1635b2a61b130e9485d591a6882aefd +++ commands.cc 3176e0a5397306096cf3ad3da067252881ddb413 @@ -1417,6 +1417,8 @@ { revision_id ident; system_path dir; + // we have a special case for "checkout .", i.e., to current dir + bool checkout_dot = false; if (args.size() > 1 || app.revision_selectors.size() > 1) throw usage(name); @@ -1431,6 +1433,8 @@ { // checkout to specified dir dir = system_path(idx(args, 0)); + if (idx(args, 0) == utf8(".")) + checkout_dot = true; } if (app.revision_selectors.size() == 0) @@ -1470,9 +1474,10 @@ % ident % app.branch_name); } - require_path_is_nonexistent(dir, - F("checkout directory '%s' already exists") - % dir); + if (!checkout_dot) + require_path_is_nonexistent(dir, + F("checkout directory '%s' already exists") + % dir); app.create_working_copy(dir); transaction_guard guard(app.db); ======================================================================== --- tests/t_checkout_dir.at 98e7c88da741590079b68cbbf44041a628315739 +++ tests/t_checkout_dir.at f300f105573d0ec40486eaeae660a6a782442961 @@ -29,4 +29,10 @@ # temporary directory. chmod 700 test_dir4 +# checkout normally is disallowed +# but as a special case, we allow "checkout ." + +mkdir test_dir5 +AT_CHECK(cd test_dir5 && MONOTONE --branch=testbranch checkout ., [], [ignore], [ignore]) + AT_CLEANUP