# # add_file "contrib/monotone-cvs-ignore.lua" # # patch "ChangeLog" # from [be429de2dd6c1f86b821c69cca1f0e77ab51bfd9] # to [98ab791434cf841224d9900a8775cee9d8af33aa] # # patch "contrib/monotone-cvs-ignore.lua" # from [] # to [9d8fe793ab5c6f3a5c21f534ceedea2796ee58eb] # # patch "lua.cc" # from [fcdcae0e83a277631f00f445a292b970ce6e76c5] # to [77945b8871b4a592a44df77fc436773db7e72f38] # # patch "std_hooks.lua" # from [89589561d3ab649c6505af849467566154b2769e] # to [6374fb70133efbd8c51a1ba6a65e3de67d28ae42] # # patch "tests/t_mt_ignore.at" # from [c2de21ee55150088d8767e659abfd41055bcb6f9] # to [363081d16393e1244dd4d4347c1c63f19ba54e36] # ======================================================================== --- ChangeLog be429de2dd6c1f86b821c69cca1f0e77ab51bfd9 +++ ChangeLog 98ab791434cf841224d9900a8775cee9d8af33aa @@ -1,5 +1,14 @@ 2005-09-01 Timothy Brownawell
+ * lua.cc, std_hooks.lua: use proper regexes for .mt-ignore + taken from a patch from Martin Dvorak + * contrib/monotone-cvs-ignore.lua: New file, from the same patch. + supports .cvsignore files + * tests/t_mt_ignore.at: check that a missing .mt-ignore + doesn't cause problems + +2005-09-01 Timothy Brownawell + * tests/t_mt_ignore.at: use RAW_MONOTONE instead of ugly --rcfile Also actually do "mtn add" this time. ======================================================================== --- contrib/monotone-cvs-ignore.lua +++ contrib/monotone-cvs-ignore.lua 9d8fe793ab5c6f3a5c21f534ceedea2796ee58eb @@ -0,0 +1,27 @@ +function glob_to_pattern(glob) + local pattern + + -- escape all special characters: + pattern = string.gsub(glob, "([%^%$%(%)%%%.%[%]%*%+%-%?])", "%%%1") + + -- convert the glob's ones to pattern's: + pattern = string.gsub(pattern, "%%%*", "[^/]*") + pattern = string.gsub(pattern, "%%%?", ".") + + return pattern +end + +function ignore_file(name) + local dir, pat1, pat2 + + dir = string.gsub(name, "/[^/]+$", "/") + if (dir == name) then dir = "" end + pat1 = "^" .. glob_to_pattern(dir) + + for line in io.lines(dir .. ".cvsignore") do + pat2 = glob_to_pattern(line) .. "$" + if (string.find(name, pat1 .. pat2)) then return true end + end + + return false +end ======================================================================== --- lua.cc fcdcae0e83a277631f00f445a292b970ce6e76c5 +++ lua.cc 77945b8871b4a592a44df77fc436773db7e72f38 @@ -20,6 +20,7 @@ #include