From bruyeron at fullsix.com Wed Aug 9 18:43:15 2006 From: bruyeron at fullsix.com (Renaud Bruyeron) Date: Wed Aug 9 18:43:07 2006 Subject: [cvsspam-devel] patch for incorrect handling of Binary adds (SVN) Message-ID: <44DA2CC3.90907@fullsix.com> Hi there, The following patch against http://svn.badgers-in-foil.co.uk/cvsspam/branches/svn_support corrects an issue in svnspam when the revision contains new binary files. best regards, - Renaud Index: svn_post_commit_hook.rb =================================================================== --- svn_post_commit_hook.rb (revision 249) +++ svn_post_commit_hook.rb (working copy) @@ -195,7 +195,24 @@ def read_added_diff(out, lines, path) lines.assert_next(/^=+$/) - m = lines.assert_next(/^---.*\(rev (\d+)\)$/) + lines.assert_next + if lines.current =~ /\(Binary files differ\)/ + process_added_binary_diff(out, lines, path) + else + process_added_text_diff(out, lines, path) + end +end + +def process_added_binary_diff(out, lines, path) + next_rev= $revision + out.puts "#V NONE,#{next_rev}" + out.puts "#A #{$shortrepo}/#{path}" + out.puts "#U diff x x" + out.puts "#U Binary file x added" +end + +def process_added_text_diff(out, lines, path) + m = lines.assert_current(/^---.*\(rev (\d+)\)$/) prev_rev = m[1].to_i diff1 = lines.current m = lines.assert_next(/^\+\+\+.*\(rev (\d+)\)$/) From haroon.rafique at utoronto.ca Wed Aug 16 18:10:21 2006 From: haroon.rafique at utoronto.ca (Haroon Rafique) Date: Wed Aug 16 18:11:01 2006 Subject: [cvsspam-devel] tagging hooks for use with cvsspam Message-ID: Hi there, First of all, thanks for the wonderful product. Kudos. Secondly, I have developed some hooks for use with taginfo/posttag which allow notifications whenever tagging events happen. If there is any interest, then I can either post to the mailing list (if list accepts attachments) or publish on a website for download. Caveats: * This is my first attempt at ruby ever. I decided to write in ruby since I was really duplicating most of the logic already present in the existing scripts. So please be gentle if and when you do provide feedback. * I am using cvs 1.12.12. From what I understand posttag hook was only added in 1.12.10. My hooks will *NOT* work with cvs 1.11.x. Theoretically these hooks should work with 1.12.10+ * You will get one email for each tagging event performed with a "cvs tag" command. However, when using a "cvs rtag" command (which I have never used), I have been told that the sequence in which the taginfo and posttag hooks run is once per directory. So you will get as many emails as the number of involved directories (again, I haven't tried this with "cvs rtag" - just speculating) Cheers, -- Haroon Rafique