# # # patch "cmd_ws_commit.cc" # from [de39e452a21e9df8ce3fa7f41fb3f86bf7ec3cd5] # to [af5edee4b145677e46e4fa360c92ba98f201d7ab] # # patch "options_list.hh" # from [35f36f423168154a9345e5ffeb35f38bbe09c300] # to [65e1d4b4b9452fe9bc66d5dcbbfed216f1f62677] # ============================================================ --- cmd_ws_commit.cc de39e452a21e9df8ce3fa7f41fb3f86bf7ec3cd5 +++ cmd_ws_commit.cc af5edee4b145677e46e4fa360c92ba98f201d7ab @@ -495,7 +495,7 @@ CMD_NO_WORKSPACE(publish, N_("tree"), N_ CMD_NO_WORKSPACE(publish, N_("tree"), N_("[DIRECTORY]"), N_("publish 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::branch | options::opts::revision | options::opts::force) { std::vector fake_args; L(FL("setting 'fake' command to checkout")); @@ -507,8 +507,12 @@ CMD_NO_WORKSPACE(publish, N_("tree"), N_ utf8 dest(idx(args, 0)); system_path dest_path(dest); -// require_path_is_nonexistent(dest_path, -// F("publish destination path '%s' already exists.") % dest_path); + + //we'll trample an existing path, but only with --force + E((app.opts.force || ! path_exists(dest_path)), + //require_path_is_nonexistent(dest_path, + F("destination path already exists.")); + system_path tmp_dir((FL("%s.tmp.%d") % dest() % get_process_id()).str()); L(FL("temporary checkout area is: %s") % tmp_dir); //system_path tmp((FL("/tmp/mtn_pub.tmp.%d") % get_process_id()).str()); ============================================================ --- options_list.hh 35f36f423168154a9345e5ffeb35f38bbe09c300 +++ options_list.hh 65e1d4b4b9452fe9bc66d5dcbbfed216f1f62677 @@ -100,6 +100,14 @@ OPTION(branch, branch, true, "branch,b", } #endif +GOPT(force, "force", bool, false, + gettext_noop("force a potentially destructive action")) +#ifdef option_bodies +{ + force = true; +} +#endif + GOPT(brief, "brief", bool, false, gettext_noop("print a brief version of the normal output")) #ifdef option_bodies