At 2007-02-26T20:14:27-0800, Justin Patrin wrote:
> key...
> unknown location(0): fatal error in "signature_round_trip":
> std::exception: boost::filesystem::path: invalid name ".monotone" in
> path: "/Users/jpatrin/.monotone/keys"
You can fix that with the attached patch.
I suspect that we only hit this in unit_tests because the normal monotone
runtime calls save_initial_path(), which results
fs::path::default_name_check(fs::native) being called.
With this patch, the unit tests are still dying:
key...
unknown location(0): fatal error in "signature_round_trip":
std::logic_error: key_store.cc:171: invariant 'I(i != keys.end())' violated
keys.cc(719): last checkpoint: signing plaintext
This is because app.get_key_pair() (called via make_signature() in the test)
goes looking for the key with ID '[EMAIL PROTECTED]' in the key store and
fails to find it.
It seems wrong to me that unit tests end up inside code that looks in
~/.monotone/keys (or cares about anything to do with the environment the
test is run in that is not explicitly set up for the test), so something
probably needs to be done to either change the test to avoid this, or
refactor the key handling/key store code to be more unit testable.
Cheers,
-mjg
--
Matthew Gregan |/
/| [EMAIL PROTECTED]
#
# old_revision [c59415d6036e6cc2ec2f34d1281e10bde0f9395d]
#
# patch "file_io.cc"
# from [db9fdc218edf3af90593b19807f91552d6164bba]
# to [2b0001d873623320022426663939033610459a60]
#
============================================================
--- file_io.cc db9fdc218edf3af90593b19807f91552d6164bba
+++ file_io.cc 2b0001d873623320022426663939033610459a60
@@ -332,7 +332,8 @@ void read_directory(any_path const & pat
files.clear();
dirs.clear();
fs::directory_iterator ei;
- for (fs::directory_iterator di(system_path(path).as_external());
+ fs::path native_path = fs::path(system_path(path).as_external(), fs::native);
+ for (fs::directory_iterator di(native_path);
di != ei; ++di)
{
fs::path entry = *di;
_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel