Merge lp:~blr/bzr/bug-1400567 into lp:bzr
Status: | Merged |
---|---|
Approved by: | Richard Wilbur |
Approved revision: | no longer in the source branch. |
Merged at revision: | 6602 |
Proposed branch: | lp:~blr/bzr/bug-1400567 |
Merge into: | lp:bzr |
Diff against target: |
226 lines (+58/-20) 3 files modified
bzrlib/patches.py (+32/-9) bzrlib/tests/test_patches.py (+22/-11) doc/en/release-notes/bzr-2.7.txt (+4/-0) |
To merge this branch: | bzr merge lp:~blr/bzr/bug-1400567 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Richard Wilbur | Approve | ||
Vincent Ladeuil | Approve | ||
Review via email: mp+244531@code.launchpad.net |
Commit message
Added keep_dirty kwarg to bzrlib.
Description of the change
Summary
Launchpad currently provides emails to users when inline diff comments are made in the context of a branch merge proposal. These emails tend to be very verbose (https:/
"=== added directory 'bish/bosh'"
"=== modified file 'foo/bar.py'"
Proposed fix
The solution proposed in this branch is to add a keep_dirty kwarg to parse_patches(). When this is set to True, parse_patches will return a dict containing both the patch and its associated dirty_headers. This will allow us to reconstruct the original diff correctly in launchpad.
Tests
A relevant test has been added in test_patches.
./bzr selftest -v patches.
> ./bzr selftest -v patches. PatchesTester
Thanks so much for telling how to test the MP !
As a thank you hint: try './bzr selftest -v -s bt.test_patches' next time ;) The difference is that your command is less precise as it can match more tests, -s (--start-with) also avoid loading tests that won't be run
Overall, your approach is very clean and well tested.
I don't really like changing the return signature depending on an input parameter (especially for a generator) but I agree with your simpler approach, we can do refactoring later if needed (which is unclear) so that all call sites use your better returned values.
Thanks for the pep8 cleanups too which account for half of this proposal. Very much appreciated.