# # # patch "ChangeLog" # from [391af203ed04d7c3e8310758530020952edef9c4] # to [053ae7a1e4c83e2758d49a690221e267f8f979ba] # # patch "cmd_ws_commit.cc" # from [11becfd50397b2ea18e37fb1e31e362b1813413d] # to [7ae041351f7337172fa93d9c81867a9bd9651c49] # # patch "paths.cc" # from [05718127de0cc031528e62d335818d46c1ae4178] # to [4c98560ebccf3c70cfa26b985403a0a3fd66fb90] # # patch "paths.hh" # from [b5689a7cb382207c3eb94edcef6aa77f312cf548] # to [ab085a0cd8dd8c6ca114d35afdccab978ce65cc6] # # patch "roster.cc" # from [76aa75696d056c98a890b0b0bb6c1164363a919e] # to [f478f2dca70407b7b277810d8b20177e889e7217] # ============================================================ --- ChangeLog 391af203ed04d7c3e8310758530020952edef9c4 +++ ChangeLog 053ae7a1e4c83e2758d49a690221e267f8f979ba @@ -1,3 +1,12 @@ +2006-06-18 Derek Scherger + + * cmd_ws_commit.cc (checkout): replace size check with call to + workspace_root + * paths.{cc,hh} (workspace_root): new function to test if a + split_path is the workspace root + * roster.cc (extract_path_set): replace size check with call to + workspace_root + 2006-06-18 Ethan Blanton * std_hooks.lua: Call the lua function get_mtn_command(host) ============================================================ --- cmd_ws_commit.cc 11becfd50397b2ea18e37fb1e31e362b1813413d +++ cmd_ws_commit.cc 7ae041351f7337172fa93d9c81867a9bd9651c49 @@ -487,9 +487,7 @@ if (is_dir_t(node)) { - if (sp.size() == 1) - I(null_name(idx(sp,0))); - else + if (!workspace_root(sp)) mkdir_p(path); } else ============================================================ --- paths.cc 05718127de0cc031528e62d335818d46c1ae4178 +++ paths.cc 4c98560ebccf3c70cfa26b985403a0a3fd66fb90 @@ -563,6 +563,13 @@ // utility /////////////////////////////////////////////////////////////////////////// +bool +workspace_root(split_path const & sp) +{ + I(null_name(idx(sp,0))); + return sp.size() == 1; +} + void dirname_basename(split_path const & sp, split_path & dirname, path_component & basename) ============================================================ --- paths.hh b5689a7cb382207c3eb94edcef6aa77f312cf548 +++ paths.hh ab085a0cd8dd8c6ca114d35afdccab978ce65cc6 @@ -120,6 +120,9 @@ return pc == the_null_component; } +bool +workspace_root(split_path const & sp); + template <> void dump(split_path const & sp, std::string & out); // It's possible this will become a proper virtual interface in the future, ============================================================ --- roster.cc 76aa75696d056c98a890b0b0bb6c1164363a919e +++ roster.cc f478f2dca70407b7b277810d8b20177e889e7217 @@ -2254,9 +2254,7 @@ node_t curr = *i; split_path pth; get_name(curr->self, pth); - if (pth.size() == 1) - I(null_name(idx(pth,0))); - else + if (!workspace_root(pth)) paths.insert(pth); } }