# # # patch "paths.cc" # from [92e0e0dbe7421fc5acc93c16a5f37dd925bd92c7] # to [405a09a6039e554e4ad159085187e96911bd2f41] # # patch "paths.hh" # from [f0d9aab30593dfde43c6fc6f999619211184f9ed] # to [ee9b6c715a8513cb94717e9c0a4af998fa4c7827] # # patch "tests/automate_show_conflicts/expected-directory-loop.stdout" # from [de5f4fbfee1d8fdafde73535041ddde66207eb2a] # to [bc03ce915219ce712cb7f2a49a783fbf750991a4] # # patch "tests/empty_string_as_a_path_name/__driver__.lua" # from [27e2081cdc69c569f84956584692067953ce3aac] # to [ba39629c4a0ba768594c9b53efa7404c136e43ab] # # patch "tests/resolve_duplicate_name_conflict/merge-1" # from [4894b9f496daee7946ebca36e761710295f9c962] # to [69adf7cdcaf299e0f803bd88e56658e8119f2cd1] # ============================================================ --- paths.cc 92e0e0dbe7421fc5acc93c16a5f37dd925bd92c7 +++ paths.cc 405a09a6039e554e4ad159085187e96911bd2f41 @@ -1123,7 +1123,6 @@ UNIT_TEST(paths, file_path_external_null "c:\\foo", "c:foo", "c:/foo", - "", // some baddies made bad by a security kluge -- // see the comment in in_bookkeeping_dir "_mtn", @@ -1157,22 +1156,21 @@ UNIT_TEST(paths, file_path_external_null check_fp_normalizes_to(".foo/bar", ".foo/bar"); check_fp_normalizes_to("..foo/bar", "..foo/bar"); check_fp_normalizes_to(".", ""); + check_fp_normalizes_to("", ""); #ifndef WIN32 check_fp_normalizes_to("foo:bar", "foo:bar"); #endif check_fp_normalizes_to("foo/with,address@hidden/bar", "foo/with,address@hidden/bar"); - // Why are these tests with // in them commented out? because boost::fs - // sucks and can't normalize them. FIXME. - //check_fp_normalizes_to("foo//bar", "foo/bar"); + check_fp_normalizes_to("foo//bar", "foo/bar"); check_fp_normalizes_to("foo/../bar", "bar"); check_fp_normalizes_to("foo/bar/", "foo/bar"); check_fp_normalizes_to("foo/bar/.", "foo/bar"); check_fp_normalizes_to("foo/bar/./", "foo/bar"); check_fp_normalizes_to("foo/./bar/", "foo/bar"); check_fp_normalizes_to("./foo", "foo"); - //check_fp_normalizes_to("foo///.//", "foo"); + check_fp_normalizes_to("foo///.//", "foo"); initial_rel_path.unset(); } @@ -1206,7 +1204,6 @@ UNIT_TEST(paths, file_path_external_pref "c:foo", "c:/foo", #endif - "", // some baddies made bad by a security kluge -- // see the comment in in_bookkeeping_dir "../../_mtn", @@ -1240,21 +1237,20 @@ UNIT_TEST(paths, file_path_external_pref check_fp_normalizes_to(".foo/bar", "a/b/.foo/bar"); check_fp_normalizes_to("..foo/bar", "a/b/..foo/bar"); check_fp_normalizes_to(".", "a/b"); + check_fp_normalizes_to("", "a/b"); #ifndef WIN32 check_fp_normalizes_to("foo:bar", "a/b/foo:bar"); #endif check_fp_normalizes_to("foo/with,address@hidden/bar", "a/b/foo/with,address@hidden/bar"); - // why are the tests with // in them commented out? because boost::fs sucks - // and can't normalize them. FIXME. - //check_fp_normalizes_to("foo//bar", "a/b/foo/bar"); + check_fp_normalizes_to("foo//bar", "a/b/foo/bar"); check_fp_normalizes_to("foo/../bar", "a/b/bar"); check_fp_normalizes_to("foo/bar/", "a/b/foo/bar"); check_fp_normalizes_to("foo/bar/.", "a/b/foo/bar"); check_fp_normalizes_to("foo/bar/./", "a/b/foo/bar"); check_fp_normalizes_to("foo/./bar/", "a/b/foo/bar"); check_fp_normalizes_to("./foo", "a/b/foo"); - //check_fp_normalizes_to("foo///.//", "a/b/foo"); + check_fp_normalizes_to("foo///.//", "a/b/foo"); // things that would have been bad without the initial_rel_path: check_fp_normalizes_to("../foo", "a/foo"); check_fp_normalizes_to("..", "a"); ============================================================ --- paths.hh f0d9aab30593dfde43c6fc6f999619211184f9ed +++ paths.hh ee9b6c715a8513cb94717e9c0a4af998fa4c7827 @@ -48,12 +48,14 @@ // is extremely fast. such strings are interpreted as being relative // to the project root. // file_path_external: use this for strings that come from the user. -// these strings are normalized before being checked, and if there is -// a problem trigger N() invariants rather than I() invariants. if in -// a workspace, such strings are interpreted as being -// _relative to the user's original directory_. -// if not in a workspace, strings are treated as referring to some -// database object directly. +// these strings are normalized before being checked, and if there +// is a problem trigger N() invariants rather than I() invariants. +// if in a workspace, such strings are interpreted as being +// _relative to the user's original directory_. if not in a +// workspace, strings are treated as relative to the tree root. The +// null string is accepted as referring to the workspace root +// directory, because that is how file_path.as_external() outputs +// that directory. // file_path's also provide optimized splitting and joining // functionality. // ============================================================ --- tests/automate_show_conflicts/expected-directory-loop.stdout de5f4fbfee1d8fdafde73535041ddde66207eb2a +++ tests/automate_show_conflicts/expected-directory-loop.stdout bc03ce915219ce712cb7f2a49a783fbf750991a4 @@ -2,7 +2,7 @@ ancestor [08ccbb14523a09d342568ce27a1b9f right [7cd48d9599eee2a67e8c510112659c0d313fb1df] ancestor [08ccbb14523a09d342568ce27a1b9f631d42aa9c] - conflict directory_loop_created + conflict directory_loop left_type "renamed directory" ancestor_name "foo" left_name "bar/foo" ============================================================ --- tests/empty_string_as_a_path_name/__driver__.lua 27e2081cdc69c569f84956584692067953ce3aac +++ tests/empty_string_as_a_path_name/__driver__.lua ba39629c4a0ba768594c9b53efa7404c136e43ab @@ -1,4 +1,4 @@ - +-- Most commands can't handle "" as a parameter, but some can. mtn_setup() addfile("testfile", "blah blah") @@ -15,4 +15,6 @@ check(mtn("--bookkeep-only", "rename", " check(mtn("--bookkeep-only", "rename", "testfile", ""), 1, false, false) check(mtn("--bookkeep-only", "rename", "", "otherfile"), 1, false, false) -check(mtn("revert", ""), 1, false, false) +-- These two have the same meaning, and the same result. +check(mtn("revert", "."), 0, false, false) +check(mtn("revert", ""), 0, false, false) ============================================================ --- tests/resolve_duplicate_name_conflict/merge-1 4894b9f496daee7946ebca36e761710295f9c962 +++ tests/resolve_duplicate_name_conflict/merge-1 69adf7cdcaf299e0f803bd88e56658e8119f2cd1 @@ -5,7 +5,7 @@ mtn: replacing content of checkout.sh wi mtn: [right] d5f1dd136c86b5bbd5e71b0c3365667e328af492 mtn: dropping checkout.sh mtn: replacing content of checkout.sh with _MTN/resolutions/checkout.sh -mtn: renaming thermostat.c to 0x4811d78 -mtn: renaming thermostat.c to 0x4862598 +mtn: renaming thermostat.c to thermostat-westinghouse.c +mtn: renaming thermostat.c to thermostat-honeywell.c mtn: [merged] 14964233a7361ada1ba962f7863d4fee12f30df7 mtn: note: your workspaces have not been updated