# # patch "lua.cc" # from [e118b794931f13bd61e84c227e21ccd1b35abf1b] # to [8aeabe8c9cd52d4e97e4f89d41172fba96180ba2] # # patch "std_hooks.lua" # from [956a176b43d8425910623c605d405c2678676e55] # to [a24b26085a5449611bb976da3f0b74200b63cfc6] # # patch "tests/t_mt_ignore.at" # from [b6cfd3651da4ea637c0208dac30b250a95fb6db1] # to [674809729cde1d8060a7a8b88304bb44253e9224] # ======================================================================== --- lua.cc e118b794931f13bd61e84c227e21ccd1b35abf1b +++ lua.cc 8aeabe8c9cd52d4e97e4f89d41172fba96180ba2 @@ -605,7 +605,13 @@ const char *str = lua_tostring(L, -1); boost::cmatch what; - lua_pushboolean(L, boost::regex_search(str, what, boost::regex(re))); + try { + lua_pushboolean(L, boost::regex_search(str, what, boost::regex(re))); + } catch(boost::bad_pattern e) { + lua_pushstring(L, e.what()); + lua_error(L); + return 0; + } return 1; } ======================================================================== --- std_hooks.lua 956a176b43d8425910623c605d405c2678676e55 +++ std_hooks.lua a24b26085a5449611bb976da3f0b74200b63cfc6 @@ -88,7 +88,16 @@ end for i, line in pairs(ignored_files) do - if (regex.search(line, name)) then return true end + local pcallstatus, result = pcall(function() if (regex.search(line, name)) then return true else return false end end) + if pcallstatus == true then + -- no error from the regex.search call + if result == true then return true end + else + -- regex.search had a problem, warn the user their .mt-ignore file syntax is wrong + io.write("\nWARNING: the line '" .. line .. "' in your .mt-ignore file caused exception '" .. result .. "'" + .. " while matching filename '" .. name .. "', ignoring this regex for all remaining files.\n\n") + table.remove(ignored_files, i) + end end -- c/c++ if (string.find(name, "%.a$")) then return true end ======================================================================== --- tests/t_mt_ignore.at b6cfd3651da4ea637c0208dac30b250a95fb6db1 +++ tests/t_mt_ignore.at 674809729cde1d8060a7a8b88304bb44253e9224 @@ -1,10 +1,7 @@ AT_SETUP([things in .mt-ignore get ignored]) MONOTONE_SETUP -# The '*.d' is not a legal regexp, and the boost::regexp exception causes monotone to die. -AT_XFAIL_IF(true) - AT_CHECK(touch foo) AT_CHECK(touch bar) AT_CHECK(mkdir baz)