# # # patch "ChangeLog" # from [385666ca736a03b361388550265c1d94096fd462] # to [4bfdcfc9180e484a2dc026a5cdc096a44aedaa00] # # patch "app_state.cc" # from [5125b76d02163ea813bd054a4b6e2c0b17942cf6] # to [da53d196b9e952d489a1deda59bb26a9798bb612] # # patch "app_state.hh" # from [d4a3ea9c7d8f40ea415be31b7019a521b54e7ef9] # to [b52ed48ef2fe80bcc7f5290b4f95d8b33165d9c3] # # patch "commands.cc" # from [44ef6fcd7921bd4be0ee3ea14a043d9727fcc77a] # to [ca6820e06f7822ec5576800cc368ba2b5a4e99f1] # # patch "monotone.cc" # from [9b11ba942536171d28183446bb2fb30338c2a2ee] # to [32e0dec22f6beac4ab8271c51ff29cd7caefb5a3] # ============================================================ --- ChangeLog 385666ca736a03b361388550265c1d94096fd462 +++ ChangeLog 4bfdcfc9180e484a2dc026a5cdc096a44aedaa00 @@ -1,5 +1,31 @@ 2006-03-12 Richard Levitte
+ Some of the monotone commands don't really need to use the data + in MT/options. As a matter of fact, it's even a really bad idea + for some command, for example 'monotone serve'. We must still + check for the MT directory and read whatever is there, just + don't immediately use the data from MT/options. I've done it by + moving the code that processes the data from MT/options in + app_state::allow_workspace to another method, which is then used + separately. + + * app_state.cc, app_state.hh (app_state::allow_workspace): The + code that processes data from MT/options and uses the information + is now moved... + (app_state::process_options): ... here. + + * commands.cc (struct command, commands::process, CMD, CMT_NO_MT): + Add a per-command flag that says if the particular command needs + to bother with the workspace options or not. CMD_NO_MT is a new + macro to help define commands that don't. + (CMD(serve)): Change into... + (CMD_NO_MT(serve)): ... this. + + * monotone.cc (cpp_main): Changed the comment so it matches + reality. + +2006-03-12 Richard Levitte + * ChangeLog: Fixup after merge lossage. 2006-03-11 Matthew Gregan ============================================================ --- app_state.cc 5125b76d02163ea813bd054a4b6e2c0b17942cf6 +++ app_state.cc da53d196b9e952d489a1deda59bb26a9798bb612 @@ -70,25 +70,10 @@ if (found_workspace) { + // We read the options, but we don't process them here. That's + // done with process_options(). read_options(); - if (!options[database_option]().empty()) - { - system_path dbname = system_path(options[database_option]); - db.set_filename(dbname); - } - - if (!options[keydir_option]().empty()) - { - system_path keydir = system_path(options[keydir_option]); - set_key_dir(keydir); - } - - if (branch_name().empty()) - branch_name = options[branch_option]; - L(FL("branch name is '%s'\n") % branch_name()); - internalize_rsa_keypair_id(options[key_option], signing_key); - if (global_sanity.filename.empty()) { bookkeeping_path dump_path; @@ -104,6 +89,29 @@ } void +app_state::process_options() +{ + if (found_workspace) { + if (!options[database_option]().empty()) + { + system_path dbname = system_path(options[database_option]); + db.set_filename(dbname); + } + + if (!options[keydir_option]().empty()) + { + system_path keydir = system_path(options[keydir_option]); + set_key_dir(keydir); + } + + if (branch_name().empty()) + branch_name = options[branch_option]; + L(FL("branch name is '%s'\n") % branch_name()); + internalize_rsa_keypair_id(options[key_option], signing_key); + } +} + +void app_state::require_workspace(std::string const & explanation) { N(found_workspace, ============================================================ --- app_state.hh d4a3ea9c7d8f40ea415be31b7019a521b54e7ef9 +++ app_state.hh b52ed48ef2fe80bcc7f5290b4f95d8b33165d9c3 @@ -92,6 +92,7 @@ boost::shared_ptr