# # patch "ChangeLog" # from [e9ef2840f22898dc2fc42b734e3df6bcf9259657] # to [365395983fc17703a6f4f3099953334e9b40c072] # # patch "commands.cc" # from [94f4c9c04cf33f1d331b529ab7461d892b09dab2] # to [1a13b18406cd0813aca1644fba757b591ff6df5f] # # patch "lua.cc" # from [df6be5cd73a13e0917cc79b8df30144a10422e1c] # to [7d6ce6d0a923bfe263b82b0254d0379a21c354a9] # # patch "paths.cc" # from [f2fe69f3895760212a53333be292da4e6cef92c4] # to [f756d2d0e4a70ba64f23a652923df12db757c501] # # patch "paths.hh" # from [e3af3c34d2cf32e279d86a64e1ce33e7093cd90f] # to [94f4c5abfbd54d869aec02f69e9824108e119972] # # patch "work.cc" # from [cb95e0b012a5aa1f95fc1d3b4a3b8c95e5e913fe] # to [6aad7b52e0799c32f82169a1d7546c09a4444a4e] # ======================================================================== --- ChangeLog e9ef2840f22898dc2fc42b734e3df6bcf9259657 +++ ChangeLog 365395983fc17703a6f4f3099953334e9b40c072 @@ -1,5 +1,13 @@ 2005-08-23 Nathaniel Smith
+ * paths.{cc,hh}: Add / operators. Make that the usual way to use + bookkeeping_path's. + * work.cc: Adjust accordingly. + * lua.cc (working_copy_rcfilename): Likewise. + * commands.cc (update): Likewise. + +2005-08-23 Nathaniel Smith + * paths.{cc,hh} (operator <<): Implement for any_paths. * paths.hh (class bookkeeping_path): Note that current design is bogus to remind myself to fix it tomorrow... ======================================================================== --- commands.cc 94f4c9c04cf33f1d331b529ab7461d892b09dab2 +++ commands.cc 1a13b18406cd0813aca1644fba757b591ff6df5f @@ -2908,7 +2908,7 @@ remaining = chosen_to_merged; } - bookkeeping_path tmp_root("tmp"); + bookkeeping_path tmp_root = bookkeeping_root / "tmp"; if (directory_exists(tmp_root)) delete_dir_recursive(tmp_root); ======================================================================== --- lua.cc df6be5cd73a13e0917cc79b8df30144a10422e1c +++ lua.cc 7d6ce6d0a923bfe263b82b0254d0379a21c354a9 @@ -659,7 +659,7 @@ void lua_hooks::working_copy_rcfilename(bookkeeping_path & file) { - file = bookkeeping_path("monotonerc"); + file = bookkeeping_root / "monotonerc"; } ======================================================================== --- paths.cc f2fe69f3895760212a53333be292da4e6cef92c4 +++ paths.cc f756d2d0e4a70ba64f23a652923df12db757c501 @@ -448,7 +448,7 @@ static void check_bk_normalizes_to(char * before, char * after) { - BOOST_CHECK(book_keeping_file(before).as_external() == after); + BOOST_CHECK((bookkeeping_root / before).as_external() == after); } static void test_bookkeeping_path() @@ -457,7 +457,6 @@ "foo//bar", "foo/../bar", "../bar", - "MT/blah", "foo/bar/", "foo/./bar", "./foo", @@ -469,7 +468,10 @@ 0 }; for (char const ** c = baddies; *c; ++c) - BOOST_CHECK_THROW(book_keeping_path(internal, *c), logic_error); + { + BOOST_CHECK_THROW(bookkeeping_path(*c), logic_error); + BOOST_CHECK_THROW(bookkeeping_root / *c, logic_error); + } check_bk_normalizes_to("", "MT"); check_bk_normalizes_to("foo", "MT/foo"); ======================================================================== --- paths.hh e3af3c34d2cf32e279d86a64e1ce33e7093cd90f +++ paths.hh 94f4c5abfbd54d869aec02f69e9824108e119972 @@ -62,6 +62,8 @@ // join a file_path out of pieces file_path(std::vector