[MERGE] The eol functionality now raises an error on an unknown eol setting (fixes bug 358199)
Jelmer Vernooij
jelmer at vernstok.nl
Fri Apr 17 22:04:54 BST 2009
Hi Brian,
Brian de Alwis wrote:
> Changed the patch to now raise an error on an unknown eol setting. And
> fixed up tabbing issues.
Thanks for working on this. I've hit this as well (trying to figure out
why my eol setting didn't work).
> === modified file 'bzrlib/filters/eol.py'
> --- bzrlib/filters/eol.py 2009-04-09 01:08:14 +0000
> +++ bzrlib/filters/eol.py 2009-04-17 19:53:42 +0000
> @@ -66,5 +66,9 @@
> [ContentFilter(_to_crlf_converter, _to_crlf_converter)],
> }
> def eol_lookup(key):
> - return _eol_filter_stack_map.get(key)
> + filter = _eol_filter_stack_map.get(key)
> + if filter is None:
> + from bzrlib.errors import BzrError
Please add imports on top of the file (per HACKING).
Any reason for not using _eol_filter_stack_map[key] here, and catching
and handling any KeyErrors?
> === modified file 'bzrlib/tests/test_eol_filters.py'
> --- bzrlib/tests/test_eol_filters.py 2009-04-02 04:12:11 +0000
> +++ bzrlib/tests/test_eol_filters.py 2009-04-17 19:53:42 +0000
> @@ -37,3 +37,31 @@
> def test_to_crlf(self):
> result = _to_crlf_converter([_sample_file1])
> self.assertEqual(["hello\r\nworld\r\n"], result)
> +
> +from bzrlib import (errors, rules)
> +from bzrlib.filters import _get_filter_stack_for
See above. Please use the same style for imports as the rest of the
file, where each module is on a separate line (to help merge, which is
line-based).
Other than that, looks good.
bb:tweak
Cheers,
Jelmer
More information about the bazaar
mailing list