Merge lp:~ian-clatworthy/bzr/eol-none-bug into lp:~bzr/bzr/trunk-old

Proposed by Ian Clatworthy
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ian-clatworthy/bzr/eol-none-bug
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 56 lines
To merge this branch: bzr merge lp:~ian-clatworthy/bzr/eol-none-bug
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+7270@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

This is another fix required to make content filtering and rule handling work. We recently introduced some stricter checking around the value of the eol setting but that broke other uses of rules, e.g. keywords and plugins using them.

A small fix and some tests are provided. I'd like this in 1.16.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Clatworthy wrote:
> Ian Clatworthy has proposed merging lp:~ian-clatworthy/bzr/eol-none-bug into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> This is another fix required to make content filtering and rule handling work. We recently introduced some stricter checking around the value of the eol setting but that broke other uses of rules, e.g. keywords and plugins using them.
>
> A small fix and some tests are provided. I'd like this in 1.16.
>

+ prefs = (('eol',None),)
this should be
+ prefs = (('eol', None),)

+ prefs = (('foo',None),('bar', 'v1'))

As should this.

But otherwise

  review approve

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkovwRQACgkQJdeBCYSNAAPO2wCeJhmXwbZnuu/FCh/R9qnMACit
vq4AoLgK9mNRY63b7atKfZGXC8loDTZ9
=+vHV
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-06-10 09:34:02 +0000
3+++ NEWS 2009-06-10 15:35:30 +0000
4@@ -84,6 +84,9 @@
5 * Fix problem of "directory not empty" when contending for a lock over
6 sftp. (Martin Pool, #340352)
7
8+* Fix rule handling so that eol is optional, not mandatory.
9+ (Ian Clatworthy, #379370)
10+
11 * Reconcile can now deal with text revisions that originated in revisions
12 that are ghosts. (Jelmer Vernooij, #336749)
13
14
15=== modified file 'bzrlib/filters/__init__.py'
16--- bzrlib/filters/__init__.py 2009-04-20 08:37:32 +0000
17+++ bzrlib/filters/__init__.py 2009-06-10 15:35:30 +0000
18@@ -247,6 +247,8 @@
19 return stack
20 stack = []
21 for k, v in preferences:
22+ if v is None:
23+ continue
24 try:
25 stack_map_lookup = _filter_stacks_registry.get(k)
26 except KeyError:
27
28=== modified file 'bzrlib/tests/test_eol_filters.py'
29--- bzrlib/tests/test_eol_filters.py 2009-05-07 05:08:46 +0000
30+++ bzrlib/tests/test_eol_filters.py 2009-06-10 15:35:30 +0000
31@@ -66,3 +66,11 @@
32 """
33 prefs = (('eol','unknown-value'),)
34 self.assertRaises(errors.BzrError, _get_filter_stack_for, prefs)
35+
36+ def test_eol_missing_altogether_is_ok(self):
37+ """
38+ Not having eol in the set of preferences should be ok.
39+ """
40+ # In this case, 'eol' is looked up with a value of None.
41+ prefs = (('eol',None),)
42+ self.assertEqual([], _get_filter_stack_for(prefs))
43
44=== modified file 'bzrlib/tests/test_filters.py'
45--- bzrlib/tests/test_filters.py 2009-04-08 03:34:31 +0000
46+++ bzrlib/tests/test_filters.py 2009-06-10 15:35:30 +0000
47@@ -156,6 +156,9 @@
48 # Test an unknown value
49 prefs = (('foo','v3'),)
50 self.assertEqual([], _get_filter_stack_for(prefs))
51+ # Test a value of None is skipped
52+ prefs = (('foo',None),('bar', 'v1'))
53+ self.assertEqual(d_stack, _get_filter_stack_for(prefs))
54 finally:
55 # Restore the real registry
56 filters._reset_registry(original_registry)