Merge lp:~thumper/launchpad/diff-tales into lp:launchpad
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 11007 | ||||||||
Proposed branch: | lp:~thumper/launchpad/diff-tales | ||||||||
Merge into: | lp:launchpad | ||||||||
Diff against target: |
504 lines (+241/-207) 3 files modified
lib/canonical/launchpad/webapp/tests/test_tales.py (+0/-205) lib/lp/app/browser/stringformatter.py (+10/-2) lib/lp/app/browser/tests/test_stringformatter.py (+231/-0) |
||||||||
To merge this branch: | bzr merge lp:~thumper/launchpad/diff-tales | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Approve | ||
Review via email: mp+27469@code.launchpad.net |
Commit message
Fix the incorrect identification of the removal of lines starting with -- or the addition of lines starting with ++ in the string diff formatter.
Description of the change
This branch fixes two very related bugs:
bug #553642: Incorrect display of diff lines starting with +++
bug #561162: diff colorization fails with deleted SQL comments
This was due to the simplistic nature of the parser. I've added a very small amount of smarts to the parser so it only looks for the file headers directly after a filename.
I also moved the stringformatter TALES tests into lp.app.
This does however obscure the actual test for this:
TestDiffForma
All the new code looks good.
I find it worrying we are munging HTML rather than munging strings before we generate the HTML (break_long_words), and that the method name doesn't indicate it accepts HTML input rather than plain text. But this is old code.