# # patch "ChangeLog" # from [9df23a2baa3247a55342a6188809040957bcb7f1] # to [dd5fc6917d93552b2ee40af4cfdb366cb813e958] # # patch "NEWS" # from [268ca8125a4334aa28342b250b3ecef5cdebb69d] # to [2bbd024be3bbebcea0325685bf322b148aa7abff] # # patch "app_state.cc" # from [cc0de5fca6542f8df529f9232a06ffe32f8b5366] # to [2d2ae92dc7b832ea49a1aa4a59871975ae25efc2] # # patch "platform.hh" # from [0e9458d97c4e769618fe133d1f1185990121e88a] # to [53e52a54ed1b569636c150010edf0a3381c9305f] # # patch "unix/fs.cc" # from [6b71610c94a70ecabfecdcf10f0aa0d880fffc7f] # to [e353582dd31c2d083e95fba1aa3c7321761a3843] # # patch "win32/fs.cc" # from [2ecc23a1ab514df19d2da8453fbd2a366837709b] # to [9ce58de1f6f841bb8bd66a3f99d465978a92df9f] # ======================================================================== --- ChangeLog 9df23a2baa3247a55342a6188809040957bcb7f1 +++ ChangeLog dd5fc6917d93552b2ee40af4cfdb366cb813e958 @@ -1,3 +1,18 @@ +2005-11-21 Matthew Gregan
+ + * NEWS: Minor spelling tweaks. + * platform.hh: Add get_default_confdir(). + * app_state.cc (app_state::app_state): Call get_default_confdir() + to initialize confdir. + * unix/fs.cc (get_default_confdir): Use the home directory as the + base of the default configuration dir. + * win32/fs.cc (get_default_confdir): Use either %APPDATA% or the + result of querying SHGetFolderPath() for CISDL_APPDATA as the base + of the default configuration dir. + (get_homedir): More consistent method for deciding what the user's + home directory is. Behaviour based on the documentation for Qt's + QDir::home(). + 2005-11-21 Nathaniel Smith * NEWS: Initial draft of 0.24 release notes. ======================================================================== --- NEWS 268ca8125a4334aa28342b250b3ecef5cdebb69d +++ NEWS 2bbd024be3bbebcea0325685bf322b148aa7abff @@ -7,17 +7,17 @@ be some complicated and varying function of %HOME%, %USERPROFILE%, %HOMEDRIVE%\%HOMEPATH%, whether you were running in mingw/cygwin, etc. It is now, always, - %APPDATA%\Monotone. For instance, if your configuration + %APPDATA%\monotone. For instance, if your configuration file used to be named - ...\Documents and Settings\.monotone\monotonerc + ...\Documents and Settings\user\.monotone\monotonerc it will now be named - ...\???\Monotone\monotonerc + ...\Documents and Settings\user\Application Data\monotone\monotonerc Please rename files appropriately. Major key management changes: - Private keys are no longer stored in your database. They are stored in ~/.monotone/keys/ (Unix, OS X) or - %APPDATA%\Monotone\keys\ (Windows). 'db migrate' will + %APPDATA%\monotone\keys\ (Windows). 'db migrate' will automatically move your keys out of your database and into their proper location. Consequences: - 'genkey' no longer requires a database. Simply run it @@ -40,7 +40,7 @@ monotone serve my.host.com "*" becomes monotone serve --bind=my.host.com "*" - or simple + or simply monotone serve "*" (to serve on the default port, on all interfaces). - Speaking of which, we can now bind to all interfaces; run ======================================================================== --- app_state.cc cc0de5fca6542f8df529f9232a06ffe32f8b5366 +++ app_state.cc 2d2ae92dc7b832ea49a1aa4a59871975ae25efc2 @@ -40,7 +40,7 @@ depth(-1), last(-1), diff_format(unified_diff), diff_args_provided(false), use_lca(false), execute(false), bind_address(""), bind_port(""), missing(false), unknown(false), - confdir(system_path(get_homedir()) / ".monotone"), have_set_key_dir(false) + confdir(get_default_confdir()), have_set_key_dir(false) { db.set_app(this); lua.set_app(this); ======================================================================== --- platform.hh 0e9458d97c4e769618fe133d1f1185990121e88a +++ platform.hh 53e52a54ed1b569636c150010edf0a3381c9305f @@ -49,6 +49,7 @@ // calls N() if fails void change_current_working_dir(any_path const & to); utf8 tilde_expand(utf8 const & path); +system_path get_default_confdir(); utf8 get_homedir(); namespace path { ======================================================================== --- unix/fs.cc 6b71610c94a70ecabfecdcf10f0aa0d880fffc7f +++ unix/fs.cc e353582dd31c2d083e95fba1aa3c7321761a3843 @@ -18,20 +18,28 @@ #include "sanity.hh" #include "platform.hh" -std::string get_current_working_dir() +std::string +get_current_working_dir() { char buffer[4096]; E(getcwd(buffer, 4096), F("cannot get working directory: %s") % std::strerror(errno)); return std::string(buffer); } - -void change_current_working_dir(any_path const & to) + +void +change_current_working_dir(any_path const & to) { E(!chdir(to.as_external().c_str()), F("cannot change to directory %s: %s") % to % std::strerror(errno)); } +system_path +get_default_confdir() +{ + return system_path(get_homedir()) / ".monotone"; +} + // FIXME: BUG: this probably mangles character sets // (as in, we're treating system-provided data as utf8, but it's probably in // the filesystem charset) @@ -42,12 +50,13 @@ if (home != NULL) return std::string(home); - struct passwd * pw = getpwuid(getuid()); + struct passwd * pw = getpwuid(getuid()); N(pw != NULL, F("could not find home directory for uid %d") % getuid()); return std::string(pw->pw_dir); } -utf8 tilde_expand(utf8 const & in) +utf8 +tilde_expand(utf8 const & in) { if (in().empty() || in()[0] != '~') return in; ======================================================================== --- win32/fs.cc 2ecc23a1ab514df19d2da8453fbd2a366837709b +++ win32/fs.cc 9ce58de1f6f841bb8bd66a3f99d465978a92df9f @@ -1,11 +1,11 @@ // copyright (C) 2005 nathaniel smith // all rights reserved. // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details +#define WIN32_LEAN_AND_MEAN #include