# # # patch "ChangeLog" # from [3b653afc6a51ac1045dbebc253b73b12ed93c6de] # to [cc2a4bcdbcc4e4d1aeda5ac560a87bf6b420e10b] # # patch "tests/inodeprints/__driver__.lua" # from [4851b2e8a82015cb048b829f551c74c6b730848d] # to [1fa3521e195de0dbfd8af44f6c0fe5925ee10242] # ============================================================ --- ChangeLog 3b653afc6a51ac1045dbebc253b73b12ed93c6de +++ ChangeLog cc2a4bcdbcc4e4d1aeda5ac560a87bf6b420e10b @@ -1,5 +1,11 @@ 2006-07-06 Nathaniel Smith + * tests/inodeprints/__driver__.lua: Add some sleep()s, so that the + clever new inodeprints logic does not notice we are changing + things very quickly and turn itself off. + +2006-07-06 Nathaniel Smith + * unix/inodeprint.cc (inodeprint_file): Add some clever logic inspired by Martin Pool, to be somewhat more robust against clock issues. This should be ported to win32, but I don't know how; I ============================================================ --- tests/inodeprints/__driver__.lua 4851b2e8a82015cb048b829f551c74c6b730848d +++ tests/inodeprints/__driver__.lua 1fa3521e195de0dbfd8af44f6c0fe5925ee10242 @@ -9,31 +9,40 @@ addfile("testfile", "blah blah") +-- We scatter these sleep()'s here, to make sure that the inodeprints will +-- actually be saved -- since we do not cache inodeprints for files that have +-- been modified very recently. +sleep(5) + check(mtn("diff"), 0, true, false) check(qgrep("blah blah", "stdout")) +-- Should still be empty, because there is nothing unchanged. +check(fsize("_MTN/inodeprints") == 0) + commit() --- Something should have been written to it +-- Something should have been written to it now check(fsize("_MTN/inodeprints") ~= 0) -copy("_MTN/inodeprints", "ip1") --- And stuff should still work +-- And things should still work check(mtn("diff"), 0, true, false) check(qgrep("no changes", "stdout")) +copy("_MTN/inodeprints", "ip1") +-- Changes are still detected writefile("testfile", "stuff stuff") - check(mtn("diff"), 0, true, false) check(qgrep("stuff stuff", "stdout")) +-- Should have changed the inodeprints file +check(mtn("refresh_inodeprints"), 0, false, false) +check(not samefile("_MTN/inodeprints", "ip1")) -- Make sure partial commit doesn't screw things up addfile("otherfile", "other stuff") +sleep(5) check(mtn("commit", "otherfile", "--message=foo"), 0, false, false) --- Should have changed the inodeprints file -check(not samefile("_MTN/inodeprints", "ip1")) - -- Still should think testfile is modified check(mtn("diff"), 0, true, false) check(qgrep("stuff stuff", "stdout"))