[bugzilla-gnome-org-extensions] 4.4 migration: Fix "Created attachment" replacement handling



commit dd0b7269518406ca2602d71698848f5561d4dbb6
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Mon Nov 17 22:44:59 2014 +0100

    4.4 migration: Fix "Created attachment" replacement handling

 lib/Ops.pm |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/Ops.pm b/lib/Ops.pm
index 7abe1fa..bd5f417 100644
--- a/lib/Ops.pm
+++ b/lib/Ops.pm
@@ -39,14 +39,14 @@ sub format_the_comment {
     # TODO: This is probably used in more places. Avoid redundancy.
     my $REVIEW_RE = qr/Review\s+of\s+attachment\s+(\d+)\s*:/;
 
-    # Add [review] link to the end of "Created an attachment" comments
+    # Add [review] link to the end of "Created attachment" comments
     #
     # We need to work around the way that the hook works, which is
     # intended to avoid overlapping matches, since we *want* an
-    # overlapping match here (the normal handling of "Created an
+    # overlapping match here (the normal handling of "Created
     # attachment"), so we add in dummy text and then replace in the
     # regular expression we return from the hook.
-    ${$text} =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\)(\s\[edit\])?)
+    ${$text} =~ s~((?:^Created\ |\b)attachment\s+(\d+)(\s\[details\])?)
                  ~(push(@$regexes, { match => qr/__REVIEW__$2/,
                                      replace => get_review_link($bug, "$2", "[review]") })) &&
                   (attachment_id_is_patch($2) ? "$1 __REVIEW__$2" : $1)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]