This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch master
in repository libparse-debianchangelog-perl.

commit 8ce5ce5018b4f9873fed2ee98a5524939c86827a
Author: Frank Lichtenheld <fr...@lichtenheld.de>
Date:   Mon Apr 4 17:25:30 2011 +0200

    bugs_to_bts: Allow to omit # before closed bug numbers
---
 Changes                                     | 1 +
 lib/Parse/DebianChangelog/ChangesFilters.pm | 6 +++---
 t/Parse-DebianChangelog-ChangesFilters.t    | 9 ++++++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Changes b/Changes
index 4b5bbf0..18f88d6 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,7 @@ Parse-DebianChangelog (1.2.0) unstable; urgency=low
 
   * ChangelogFilters:
     - Fix conversion of <http://something/> (Closes: #603341)
+    - Allow to omit # before closed bug numbers (Closes: 446798 ;)
 
  -- Frank Lichtenheld <fr...@lichtenheld.de>  Mon, 04 Apr 2011 16:43:54 +0200
 
diff --git a/lib/Parse/DebianChangelog/ChangesFilters.pm 
b/lib/Parse/DebianChangelog/ChangesFilters.pm
index 1309124..17aa995 100644
--- a/lib/Parse/DebianChangelog/ChangesFilters.pm
+++ b/lib/Parse/DebianChangelog/ChangesFilters.pm
@@ -93,9 +93,9 @@ sub email_to_ddpo {
 }
 
 sub bugs_to_bts {
-    (my $text = $_[0]) =~ s|Closes:\s*(?:Bug)?\#\d+(?:\s*,\s*(?:Bug)?\#\d+)*
-       |my $tmp = $&; { no warnings;
-                        $tmp =~ s@(Bug)?\#(\d+)@<a class="buglink" 
href="http://bugs.debian.org/$2";>$1\#$2</a>@ig; }
+    (my $text = $_[0]) =~ 
s|(Closes:\s*(?:Bug)?\#?\d+(?:\s*,\s*(?:Bug)?\#?\d+)*)
+       |my $tmp = $1; { no warnings;
+                        $tmp =~ s@(Bug)?\#?(\d+)@<a class="buglink" 
href="http://bugs.debian.org/$2";>$1\#$2</a>@ig; }
     "$tmp"
        |xiego;
     return $text;
diff --git a/t/Parse-DebianChangelog-ChangesFilters.t 
b/t/Parse-DebianChangelog-ChangesFilters.t
index 071fba9..3b8a0c3 100644
--- a/t/Parse-DebianChangelog-ChangesFilters.t
+++ b/t/Parse-DebianChangelog-ChangesFilters.t
@@ -53,6 +53,13 @@ is( $text,
     'This (Closes: <a class="buglink" 
href="http://bugs.debian.org/123456";>#123456</a>, <a class="buglink" 
href="http://bugs.debian.org/4321";>Bug#4321</a>, <a class="buglink" 
href="http://bugs.debian.org/222";>#222</a>) (hopefully, maybe closes #72345, 
too)',
     'bugs_to_bts' );
 
+$text = bugs_to_bts( 'This (Closes: 123456, Bug#4321, 222) (hopefully, maybe 
closes #72345, too)',
+                    $cgi );
+
+is( $text,
+    'This (Closes: <a class="buglink" 
href="http://bugs.debian.org/123456";>#123456</a>, <a class="buglink" 
href="http://bugs.debian.org/4321";>Bug#4321</a>, <a class="buglink" 
href="http://bugs.debian.org/222";>#222</a>) (hopefully, maybe closes #72345, 
too)',
+    'bugs_to_bts' );
+
 $text = cve_to_mitre( 'SECURITY FIXES (CAN-2005-9999, CVE-2004-9999):',
                      $cgi );
 
@@ -79,7 +86,7 @@ hällö & tschüß <tt id="a">:)</tt>
 foo http://foo.com/cgi-bin/t.cgi?id=bar&name=bar bar
 foo <http://foo.com/cgi-bin/t.cgi?id=bar&name=bar> bar
 Frank Lichtenheld <dj...@debian.org>
-This (Closes: #123456, Bug#4321, #222) (hopefully, maybe closes #72345, too)
+This (Closes: #123456, Bug#4321, 222) (hopefully, maybe closes #72345, too)
 SECURITY FIXES (CAN-2005-9999, CVE-2004-9999):
 This is a test for *emphasised texts -- and* *more*, we can also make this 
#really really strong#, #really#
 And a quick test for /usr/share/common-licenses/GPL-2 license textes

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libparse-debianchangelog-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to