Merge lp:~jameinel/bzr/2.0.3-433779-sanitize-commit-m into lp:bzr
Proposed by
John A Meinel
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~jameinel/bzr/2.0.3-433779-sanitize-commit-m | ||||
Merge into: | lp:bzr | ||||
Diff against target: |
132 lines 5 files modified
NEWS (+38/-0) bzr (+4/-0) bzrlib/__init__.py (+4/-0) bzrlib/builtins.py (+3/-0) bzrlib/tests/blackbox/test_commit.py (+18/-0) |
||||
To merge this branch: | bzr merge lp:~jameinel/bzr/2.0.3-433779-sanitize-commit-m | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Approve | ||
Review via email: mp+14377@code.launchpad.net |
To post a comment you must log in.
This is a basic bugfix for bug #433779. The change is that if you supply a commit message (via -m ...) it sanitizes '\r\n' => '\n' and '\r' => '\n'.
The reason we don't allow '\r' is because our XML parsers silently translates it anyway, so we want to make sure that users are getting what they entered.
*Personally* I would have preferred Emac's bzr integration to pass '\n' appropriately rather than '\r\n', but this is a reasonable compromise.
Note that this code translates '\r\n' always, rather than only on Windows, etc... It also doesn't try to translate the message from '--file', because we open that file in 'text' mode anyway.
The test is pretty straightforward. Without the patch, the test fails with "ValueError" because we don't allow '\r'.
I did the patch on top on top of 2.0 in case we want to have it there. It was 'just' at the threshold of what I would be comfortable with, which is why I'm proposing it for bzr.dev/2.1 first.