Merge lp://staging/~julian-edwards/launchpad/ignore-case-bug-394752 into lp://staging/launchpad

Proposed by Julian Edwards
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~julian-edwards/launchpad/ignore-case-bug-394752
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~julian-edwards/launchpad/ignore-case-bug-394752
Reviewer Review Type Date Requested Status
Gavin Panella (community) code Approve
Review via email: mp+11426@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Make lower-case 'lp:' match when linkifying source package change logs

== Proposed fix ==
Trival: re.IGNORECASE flag added to the regex.

== Tests ==
bin/test -cvvt sourcepackage.txt

== Demo and Q/A ==
Will Q/A using the example URL posted in
https://launchpad.net/ubuntu/+source/pybootchartgui

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/soyuz/browser/sourcepackagerelease.py
  lib/lp/registry/doc/sourcepackage.txt

Revision history for this message
Gavin Panella (allenap) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/doc/sourcepackage.txt'
--- lib/lp/registry/doc/sourcepackage.txt 2009-07-23 13:44:13 +0000
+++ lib/lp/registry/doc/sourcepackage.txt 2009-09-09 11:52:55 +0000
@@ -372,6 +372,11 @@
372 u'LP: <a href="/bugs/10" title="another test bug">#10</a>372 u'LP: <a href="/bugs/10" title="another test bug">#10</a>
373 LP: <a href="/bugs/10" title="another test bug">#10</a>'373 LP: <a href="/bugs/10" title="another test bug">#10</a>'
374374
375The regex is case-insensitive, so "lp: #nnn" also works.
376
377 >>> spr_view._linkify_bug_numbers("lp: #10")
378 u'lp: <a href="/bugs/10" title="another test bug">#10</a>'
379
375380
376== Comparing Sourcepackages ==381== Comparing Sourcepackages ==
377382
378383
=== modified file 'lib/lp/soyuz/browser/sourcepackagerelease.py'
--- lib/lp/soyuz/browser/sourcepackagerelease.py 2009-06-25 04:06:00 +0000
+++ lib/lp/soyuz/browser/sourcepackagerelease.py 2009-09-09 11:52:55 +0000
@@ -62,7 +62,8 @@
62 # feeding the result into another regex to pull out the bug and62 # feeding the result into another regex to pull out the bug and
63 # bugnum groups.63 # bugnum groups.
64 line_matches = re.finditer(64 line_matches = re.finditer(
65 'LP:\s*(?P<buglist>(.+?[^,]))($|\n)', changelog, re.DOTALL)65 'LP:\s*(?P<buglist>(.+?[^,]))($|\n)', changelog,
66 re.DOTALL | re.IGNORECASE)
66 seen_bugnums = set()67 seen_bugnums = set()
67 for line_match in line_matches:68 for line_match in line_matches:
68 bug_matches = re.finditer(69 bug_matches = re.finditer(