# # patch ".mt-attrs" # from [8287c8c8f48067074ca9e114e6aec78129343f60] # to [f64f76c6bd0167f72362edd8c47724dffbe31907] # # patch "ChangeLog" # from [ea8f43287b62029afd6f494d7ead08be177ae6c0] # to [c58ed9418443cc972728ab7c5757911fb9460028] # # patch "contrib/perf-test.sh" # from [532119a8ca3587ec6d9f4daa887d225b9db0cb1f] # to [37672e98ef9148f8aef18ac7a520139d8de860d9] # # patch "lua.cc" # from [77945b8871b4a592a44df77fc436773db7e72f38] # to [0f9c2ad7d3ef7969825d0f2d48333216d077f42b] # ======================================================================== --- .mt-attrs 8287c8c8f48067074ca9e114e6aec78129343f60 +++ .mt-attrs f64f76c6bd0167f72362edd8c47724dffbe31907 @@ -22,5 +22,11 @@ file "contrib/mtbrowse.sh" execute "true" + file "contrib/parse-accounting.pl" +execute "true" + + file "contrib/perf-test.sh" +execute "true" + file "debian/rules" execute "true" ======================================================================== --- ChangeLog ea8f43287b62029afd6f494d7ead08be177ae6c0 +++ ChangeLog c58ed9418443cc972728ab7c5757911fb9460028 @@ -1,3 +1,12 @@ +2005-09-02 Matt Johnston + + * lua.cc (monotone_guess_binary_file_contents_for_lua): use a temporary + char* buffer rather than &string[], extra copying seems to have negligible + performance impact. + + * tests/perf-test.sh: change path from tests/ to contrib/, make executable. + * tests/parse-accounting.pl: make executable. + 2005-09-01 Timothy Brownawell * lua.cc, std_hooks.lua: use proper regexes for .mt-ignore ======================================================================== --- contrib/perf-test.sh 532119a8ca3587ec6d9f4daa887d225b9db0cb1f +++ contrib/perf-test.sh 37672e98ef9148f8aef18ac7a520139d8de860d9 @@ -14,13 +14,13 @@ exit 1 fi -PARSE_ACCOUNT=`pwd`/tests/parse-accounting.pl +PARSE_ACCOUNT=`pwd`/contrib/parse-accounting.pl if [ -x $PARSE_ACCOUNT ]; then : -elif [ -x `dirname $MONOTONE`/tests/parse-accounting.pl ]; then - PARSE_ACCOUNT=`dirname $MONOTONE`/tests/parse-accounting.pl +elif [ -x `dirname $MONOTONE`/contrib/parse-accounting.pl ]; then + PARSE_ACCOUNT=`dirname $MONOTONE`/contrib/parse-accounting.pl else - echo "can't find parse-accounting.pl. Looked in `pwd`/tests, and `dirname $MONOTONE`/tests" + echo "can't find parse-accounting.pl. Looked in `pwd`/contrib, and `dirname $MONOTONE`/contrib" exit 1 fi ======================================================================== --- lua.cc 77945b8871b4a592a44df77fc436773db7e72f38 +++ lua.cc 0f9c2ad7d3ef7969825d0f2d48333216d077f42b @@ -533,12 +533,13 @@ return 1; } const int bufsize = 8192; + char tmpbuf[bufsize]; string buf; while(file.good()) { - buf.resize(bufsize); - file.read(&buf[0],bufsize); - buf.resize(file.gcount()); + file.read(tmpbuf, sizeof(tmpbuf)); + I(file.gcount <= sizeof(tmpbuf)); + buf.assign(tmpbuf, file.gcount()); if (guess_binary(buf)) { lua_pushboolean(L, true);