[Bps-public-commit] r18271 - Net-Trac/trunk/lib/Net/Trac

jesse at bestpractical.com jesse at bestpractical.com
Fri Feb 6 18:18:19 EST 2009


Author: jesse
Date: Fri Feb  6 18:18:18 2009
New Revision: 18271

Modified:
   Net-Trac/trunk/lib/Net/Trac/TicketHistoryEntry.pm

Log:
Skip transaction history types we don't know how to deal with

Modified: Net-Trac/trunk/lib/Net/Trac/TicketHistoryEntry.pm
==============================================================================
--- Net-Trac/trunk/lib/Net/Trac/TicketHistoryEntry.pm	(original)
+++ Net-Trac/trunk/lib/Net/Trac/TicketHistoryEntry.pm	Fri Feb  6 18:18:18 2009
@@ -93,18 +93,27 @@
 
     foreach my $line (@prop_lines) {
         my ($prop, $old, $new);
+        if ($line =~ m{<strong>attachment</strong>}) {
+            # we can't handle trac's "attahcment changes" messages yet
+            next;
+        }
+        if ($line =~ m{<strong>description</strong>}) {
+            # We can't parse trac's crazy "go read a diff on a webpage handling 
+            # of descriptions
+            next; 
+        }
         if ($line =~ m{<strong>keywords</strong>(.*)$}is ) {
             my $value_changes = $1;
             $prop = 'keywords';
             my (@added, @removed);
-            if ($value_changes =~ m{^\s*<em>(.*?)</em> added;?}is) {
+            if ($value_changes =~ m{^\s*<em>(.*?)</em> added}is) {
                     my $added = $1;
                     @added = split(m{</em>\s*<em>}is, $added);
                 }  
 
-            if ($value_changes =~ m{(?:^|;)\s*<em>(.*)</em> removed}is) {
+            if ($value_changes =~ m{(?:^|added;)\s*<em>(.*)</em> removed}is) {
                     my $removed = $1;
-                    @removed = split(m{</em>\s*<em>}is, $removed);
+                    @removed = split(m{</em>\s*?<em>}is, $removed);
 
             }
           



More information about the Bps-public-commit mailing list