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
1=== modified file 'lib/lp/registry/doc/sourcepackage.txt'
2--- lib/lp/registry/doc/sourcepackage.txt 2009-07-23 13:44:13 +0000
3+++ lib/lp/registry/doc/sourcepackage.txt 2009-09-09 11:52:55 +0000
4@@ -372,6 +372,11 @@
5 u'LP: <a href="/bugs/10" title="another test bug">#10</a>
6 LP: <a href="/bugs/10" title="another test bug">#10</a>'
7
8+The regex is case-insensitive, so "lp: #nnn" also works.
9+
10+ >>> spr_view._linkify_bug_numbers("lp: #10")
11+ u'lp: <a href="/bugs/10" title="another test bug">#10</a>'
12+
13
14 == Comparing Sourcepackages ==
15
16
17=== modified file 'lib/lp/soyuz/browser/sourcepackagerelease.py'
18--- lib/lp/soyuz/browser/sourcepackagerelease.py 2009-06-25 04:06:00 +0000
19+++ lib/lp/soyuz/browser/sourcepackagerelease.py 2009-09-09 11:52:55 +0000
20@@ -62,7 +62,8 @@
21 # feeding the result into another regex to pull out the bug and
22 # bugnum groups.
23 line_matches = re.finditer(
24- 'LP:\s*(?P<buglist>(.+?[^,]))($|\n)', changelog, re.DOTALL)
25+ 'LP:\s*(?P<buglist>(.+?[^,]))($|\n)', changelog,
26+ re.DOTALL | re.IGNORECASE)
27 seen_bugnums = set()
28 for line_match in line_matches:
29 bug_matches = re.finditer(