# # # rename "tests/publish" # to "tests/export" # # patch "ChangeLog" # from [a1a364ec8e7926e996c5abb646d6a7df6e61a2cb] # to [f28fcdeedf4f2c774beadc6442010099179c59cb] # # patch "cmd_ws_commit.cc" # from [fad7244081d40204af5e832e5037447fe1160f54] # to [b241b9ccb8aa6a2bd032b7cd1de24cba7d2766ca] # # patch "monotone.texi" # from [3643c20e93dcc79a173601cb33ea9a6e004a7471] # to [189b6f38243b11023d67918ee1becef49aa4d1e3] # # patch "tests/export/__driver__.lua" # from [6a30a6e59827316789c2a8fab4b7991987ab620d] # to [9a47a415884cfd5d3891ce3cb63de66f18bae72c] # # patch "testsuite.lua" # from [4eb6a85cd96f7001105d94c1623b2def71a388fa] # to [81c8e4aea652fb82e6c5499a6ee9d9a5741da25b] # ============================================================ --- ChangeLog a1a364ec8e7926e996c5abb646d6a7df6e61a2cb +++ ChangeLog f28fcdeedf4f2c774beadc6442010099179c59cb @@ -1,7 +1,8 @@ 2006-12-21 Ben Walton - * cmd_ws_commit.cc (CMD_NO_WORKSPACE(publish)): added this + * cmd_ws_commit.cc (CMD_NO_WORKSPACE(export)): added this command, which exports a revision/branch from the db. - * options_list.hh: added a --force to be used with publish. + * Aliased publish to export. + * options_list.hh: added a --force to be used with export. * monotone.texi: added documentation for the new command. 2006-12-18 Richard Levitte ============================================================ --- cmd_ws_commit.cc fad7244081d40204af5e832e5037447fe1160f54 +++ cmd_ws_commit.cc b241b9ccb8aa6a2bd032b7cd1de24cba7d2766ca @@ -492,8 +492,8 @@ CMD(status, N_("informative"), N_("[PATH } } -CMD_NO_WORKSPACE(publish, N_("tree"), N_("[DIRECTORY]"), - N_("publish a revision from a database to a directory.\n" +CMD_NO_WORKSPACE(export, N_("tree"), N_("[DIRECTORY]"), + N_("export a revision from a database to a directory.\n" "the resulting filesystem tree will not be a workspace."), options::opts::branch | options::opts::revision | options::opts::force) { @@ -508,7 +508,7 @@ CMD_NO_WORKSPACE(publish, N_("tree"), N_ //not sure if this is really necessary as a precaution, //but we'll leave it for now. - N(dest() != ".", F("we won't publish to the cwd")); + N(dest() != ".", F("we won't export to the cwd")); system_path dest_path(dest); @@ -545,7 +545,6 @@ CMD_NO_WORKSPACE(publish, N_("tree"), N_ delete_dir_recursive(tmp_dir/"_MTN"); L(FL("removed")); - //if we're here, and the path exists, we were 'forced' //we'll move the existing path out of the way before moving the //temp checkout in place. @@ -560,6 +559,8 @@ CMD_NO_WORKSPACE(publish, N_("tree"), N_ move_path(tmp_dir, dest_path); } +ALIAS(publish, export) + CMD(checkout, N_("tree"), N_("[DIRECTORY]"), N_("check out a revision from database into directory.\n" "If a revision is given, that's the one that will be checked out.\n" ============================================================ --- monotone.texi 3643c20e93dcc79a173601cb33ea9a6e004a7471 +++ monotone.texi 189b6f38243b11023d67918ee1becef49aa4d1e3 @@ -4003,6 +4003,8 @@ @section Tree With an explicit @option{--revision} argument, the command outputs contents of @var{path} at that revision. address@hidden mtn export [--force] address@hidden address@hidden @var{destination_directory} address@hidden mtn export address@hidden @var{destination_directory} @item mtn publish [--force] address@hidden address@hidden @var{destination_directory} @itemx mtn publish address@hidden @var{destination_directory} @@ -4013,7 +4015,8 @@ @section Tree proceed at all. Monotone will not publish to the current working directory (.). In the case where @var{destination_directory} exists and is a directory and @option{--force} is supplied, the original directory will be preserved as address@hidden@address@hidden of mtn address@hidden address@hidden@address@hidden of mtn address@hidden Publish is an +alias for export. @item mtn checkout address@hidden @var{directory} @itemx mtn co address@hidden @var{directory} ============================================================ --- tests/export/__driver__.lua 6a30a6e59827316789c2a8fab4b7991987ab620d +++ tests/export/__driver__.lua 9a47a415884cfd5d3891ce3cb63de66f18bae72c @@ -1,42 +1,42 @@ check(mtn("ci", "--message=test", "--bra skip_if(not existsonpath("test")) mtn_setup() addfile("readme.txt", "nothing to see here\n") check(mtn("ci", "--message=test", "--branch=testbranch"), 0, false, false) -check({"touch", "test_publish"}, 0, false, false) +check({"touch", "test_export"}, 0, false, false) --no args -check(mtn("publish"), 2, false, false) +check(mtn("export"), 2, false, false) --db, but no revision -check(mtn("publish", "--db=test.db"), 2, false, false) +check(mtn("export", "--db=test.db"), 2, false, false) --db and revision, but no dest dir -check(mtn("publish", "--db=test.db", "--branch=testbranch"), 2, false, false) +check(mtn("export", "--db=test.db", "--branch=testbranch"), 2, false, false) --proper args, but checkout to . should fail -check(mtn("publish", "--db=test.db", "--branch=testbranch", "."), 1, false, false) +check(mtn("export", "--db=test.db", "--branch=testbranch", "."), 1, false, false) ---db and revision, but test_publish is a file! -check(mtn("publish", "--db=test.db", "--branch=testbranch", "test_publish"), 1, false, false) +--db and revision, but test_export is a file! +check(mtn("export", "--db=test.db", "--branch=testbranch", "test_export"), 1, false, false) --proper args, should work -check({"rm", "test_publish"}, 0, false, false) -check(mtn("publish", "--db=test.db", "--branch=testbranch", "test_publish"), 0, false, false) -check({"test", "-d", "test_publish"}, 0, false, false) -check({"test", "-f", "test_publish/readme.txt"}, 0, false, false) +check({"rm", "test_export"}, 0, false, false) +check(mtn("export", "--db=test.db", "--branch=testbranch", "test_export"), 0, false, false) +check({"test", "-d", "test_export"}, 0, false, false) +check({"test", "-f", "test_export/readme.txt"}, 0, false, false) --now, the dest exists but is a directory. fail still -check(mtn("publish", "--db=test.db", "-r h:testbranch", "test_publish"), 1, false, false) +check(mtn("export", "--db=test.db", "-r h:testbranch", "test_export"), 1, false, false) --there shouldn't be a backup in this case -check({"ls", "-1d", "test_publish*bak*"}, 2, false, false) +check({"ls", "-1d", "test_export*bak*"}, 2, false, false) --verify that the backup directory doesn't exist yet... check({"ls"}, 0, true, false) -check(not qgrep("test_publish.bak", "stdout")) +check(not qgrep("test_export.bak", "stdout")) --do my bidding! (--force) -check(mtn("publish", "--db=test.db", "--branch=testbranch", "--force", "test_publish"), 0, false, false) +check(mtn("export", "--db=test.db", "--branch=testbranch", "--force", "test_export"), 0, false, false) --verify that the backup directory was created. check({"ls"}, 0, true, false) +check(qgrep("test_export.bak", "stdout")) -check(qgrep("test_publish.bak", "stdout")) ============================================================ --- testsuite.lua 4eb6a85cd96f7001105d94c1623b2def71a388fa +++ testsuite.lua 81c8e4aea652fb82e6c5499a6ee9d9a5741da25b @@ -696,4 +696,4 @@ table.insert(tests, "fail_cleanly_when__ table.insert(tests, "log_--to") table.insert(tests, "mkdir") table.insert(tests, "fail_cleanly_when__MTN_format_corrupt") +table.insert(tests, "export") -table.insert(tests, "publish")