|
|
@@ -107,3 +107,60 @@ Index: ssh_agent.hh
|
|
|
void sign_data(Botan::RSA_PublicKey const & key,
|
|
|
std::string const & data,
|
|
|
std::string & out);
|
|
|
+
|
|
|
+-----------------------------------------------------------------------------
|
|
|
+
|
|
|
+Upstream fix:
|
|
|
+
|
|
|
+If the options --db or --keydir were previously specified for a
|
|
|
+command which was executed inside a workspace and one or both
|
|
|
+option arguments were invalid (f.e. invalid paths), they were
|
|
|
+still written to _MTN/options of the particular workspace.
|
|
|
+This lead to errors on any subsequent command which used these
|
|
|
+options. This bug is fixed in so far that basic file type
|
|
|
+checks are applied on both options, so its no longer possible
|
|
|
+to set non-existing paths accidently or use a path to a directory
|
|
|
+as option argument for --db.
|
|
|
+
|
|
|
+Index: work.cc
|
|
|
+--- work.cc 9c9fd46396607ec971ccf77b6dbdfe54934b9ec5
|
|
|
++++ work.cc 0261cdf7dbc3baed0cdfc0e75a3a858f64eefa97
|
|
|
+@@ -180,7 +180,7 @@ workspace::workspace(app_state & app, i1
|
|
|
+ set_ws_options(app.opts, false);
|
|
|
+ }
|
|
|
+
|
|
|
+-workspace::workspace(options const & opts, lua_hooks & lua,
|
|
|
++workspace::workspace(options const & opts, lua_hooks & lua,
|
|
|
+ i18n_format const & explanation, bool writeback_options)
|
|
|
+ : lua(lua)
|
|
|
+ {
|
|
|
+@@ -509,9 +509,15 @@ workspace::set_ws_options(options const
|
|
|
+ read_options_file(o_path,
|
|
|
+ database_option, branch_option, key_option, keydir_option);
|
|
|
+
|
|
|
+- if (!opts.dbname.as_internal().empty())
|
|
|
++ // FIXME: we should do more checks here, f.e. if this is a valid sqlite
|
|
|
++ // file and if it contains the correct identifier, but these checks would
|
|
|
++ // duplicate those in database.cc. At the time it is checked there, however,
|
|
|
++ // the options file for the workspace is already written out...
|
|
|
++ if (!opts.dbname.as_internal().empty() &&
|
|
|
++ get_path_status(opts.dbname.as_internal()) == path::file)
|
|
|
+ database_option = opts.dbname;
|
|
|
+- if (!opts.key_dir.as_internal().empty())
|
|
|
++ if (!opts.key_dir.as_internal().empty() &&
|
|
|
++ get_path_status(opts.key_dir.as_internal()) == path::directory)
|
|
|
+ keydir_option = opts.key_dir;
|
|
|
+ if ((branch_is_sticky || workspace::branch_is_sticky)
|
|
|
+ && !opts.branchname().empty())
|
|
|
+@@ -1570,8 +1576,8 @@ workspace::perform_rename(database & db,
|
|
|
+ // touch foo
|
|
|
+ // mtn mv foo bar/foo where bar doesn't exist
|
|
|
+ file_path parent = dst.dirname();
|
|
|
+- N(get_path_status(parent) == path::directory,
|
|
|
+- F("destination path's parent directory %s/ doesn't exist") % parent);
|
|
|
++ N(get_path_status(parent) == path::directory,
|
|
|
++ F("destination path's parent directory %s/ doesn't exist") % parent);
|
|
|
+ }
|
|
|
+
|
|
|
+ renames.insert(make_pair(src, dpath));
|
|
|
+
|