# # # add_dir "tests/--no-workspace" # # add_file "tests/--no-workspace/__driver__.lua" # content [b366597e20706ecbe069d66adf4093c4715e975a] # # patch "NEWS" # from [9c5d25d2cdcadc89cf3448dd39f073a4e14866bd] # to [6497507f4ede2a4e15eb85e875a69ae954c7b8b0] # # patch "monotone.cc" # from [c675c913e89752c4e38fc3e0410a40e7157f42ef] # to [79955d57cc2fba7659099e5d56f9d1159fcda99f] # # patch "monotone.texi" # from [8542311382a69a2d94963663f5336ad83f842ea2] # to [5e2bb7643436006b6bf4a7883eb6ac40eb4efdda] # # patch "options_list.hh" # from [cd0ff5a0d051b4644c02a5f81ed262a512c65360] # to [93e1285e0f6cd24e045a53bdb689af5739f94e9c] # ============================================================ --- tests/--no-workspace/__driver__.lua b366597e20706ecbe069d66adf4093c4715e975a +++ tests/--no-workspace/__driver__.lua b366597e20706ecbe069d66adf4093c4715e975a @@ -0,0 +1,5 @@ +mtn_setup() + +addfile("foo", "bar") +check(mtn("commit", "-mx", "--no-workspace"), 1, false, false) +check(mtn("commit", "-mx"), 0, false, false) \ No newline at end of file ============================================================ --- NEWS 9c5d25d2cdcadc89cf3448dd39f073a4e14866bd +++ NEWS 6497507f4ede2a4e15eb85e875a69ae954c7b8b0 @@ -25,6 +25,9 @@ - New 'mtn ls duplicates' command which lets you list duplicated files in a given revision or the workspace. + - New option --no-workspace, to make monotone ignore any + workspace it might have been run in. + Internal - Update Botan to 1.7.12. ============================================================ --- monotone.cc c675c913e89752c4e38fc3e0410a40e7157f42ef +++ monotone.cc 79955d57cc2fba7659099e5d56f9d1159fcda99f @@ -221,7 +221,14 @@ cpp_main(int argc, char ** argv) // and if found, change directory to it // Certain commands may subsequently require a workspace or fail // if we didn't find one at this point. - workspace::found = find_and_go_to_workspace(app.opts.root); + if (app.opts.no_workspace) + { + workspace::found = false; + } + else + { + workspace::found = find_and_go_to_workspace(app.opts.root); + } // Load all available monotonercs. If we found a workspace above, // we'll pick up _MTN/monotonerc as well as the user's monotonerc. ============================================================ --- monotone.texi 8542311382a69a2d94963663f5336ad83f842ea2 +++ monotone.texi 5e2bb7643436006b6bf4a7883eb6ac40eb4efdda @@ -2930,7 +2930,8 @@ @heading Finding a workspace @file{_MTN} directory is found or the filesystem root is reached. Upon finding an @file{_MTN} directory, the @file{_MTN/options} file is read for default options. The @option{--root} option may be used to stop the -search early, before reaching the root of the physical filesystem. +search early, before reaching the root of the physical filesystem. The address@hidden option may be used to prevent the search entirely. Many monotone commands don't require a workspace and will simply proceed with no default options if no @file{_MTN} directory is found. ============================================================ --- options_list.hh cd0ff5a0d051b4644c02a5f81ed262a512c65360 +++ options_list.hh 93e1285e0f6cd24e045a53bdb689af5739f94e9c @@ -527,6 +527,14 @@ GOPT(root, "root", std::string, , } #endif +GOPT(no_workspace, "no-workspace", bool, false, + gettext_noop("don't look for a workspace")) +#ifdef option_bodies +{ + no_workspace = true; +} +#endif + OPT(set_default, "set-default", bool, false, gettext_noop("use the current arguments as the future default")) #ifdef option_bodies