Merge lp:~mbp/bzr/892622-feature-api into lp:bzr

Proposed by Martin Pool
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 6281
Proposed branch: lp:~mbp/bzr/892622-feature-api
Merge into: lp:bzr
Diff against target: 93 lines (+28/-29)
2 files modified
bzrlib/tests/__init__.py (+26/-5)
bzrlib/tests/features.py (+2/-24)
To merge this branch: bzr merge lp:~mbp/bzr/892622-feature-api
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+82808@code.launchpad.net

Commit message

restore old api name bzrlib.tests.Features to unbreak some plugins

Description of the change

Moving bzrlib.tests.Feature to bzrlib.tests.features broke some plugins, somewhat unnecessarily.

This restores the old name, deprecated. (Users don't see deprecation warnings.)

This is probably easier than updating all the otherwise-stable plugins.

Thanks to Matt Giuca for reporting this.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I think most plugins have long been fixed, but I guess this is still useful if people happen to have older versions of the plugins installed.

review: Approve (code)
Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py 2011-11-16 15:57:14 +0000
+++ bzrlib/tests/__init__.py 2011-11-21 00:14:24 +0000
@@ -100,6 +100,7 @@
100 )100 )
101from bzrlib.ui import NullProgressView101from bzrlib.ui import NullProgressView
102from bzrlib.ui.text import TextUIFactory102from bzrlib.ui.text import TextUIFactory
103from bzrlib.tests.features import _CompatabilityThunkFeature
103104
104# Mark this python module as being part of the implementation105# Mark this python module as being part of the implementation
105# of unittest: this gives us better tracebacks where the last106# of unittest: this gives us better tracebacks where the last
@@ -4462,8 +4463,28 @@
4462 pass4463 pass
44634464
44644465
4465@deprecated_function(deprecated_in((2, 5, 0)))4466# API compatibility for old plugins; see bug 892622.
4466def ModuleAvailableFeature(name):4467for name in [
4467 from bzrlib.tests import features4468 'Feature',
4468 return features.ModuleAvailableFeature(name)4469 'HTTPServerFeature',
4469 4470 'ModuleAvailableFeature',
4471 'HTTPSServerFeature', 'SymlinkFeature', 'HardlinkFeature',
4472 'OsFifoFeature', 'UnicodeFilenameFeature',
4473 'ByteStringNamedFilesystem', 'UTF8Filesystem',
4474 'BreakinFeature', 'CaseInsCasePresFilenameFeature',
4475 'CaseInsensitiveFilesystemFeature', 'case_sensitive_filesystem_feature',
4476 'posix_permissions_feature',
4477 ]:
4478 globals()[name] = _CompatabilityThunkFeature(
4479 symbol_versioning.deprecated_in((2, 5, 0)),
4480 'bzrlib.tests', name,
4481 name, 'bzrlib.tests.features')
4482
4483
4484for (old_name, new_name) in [
4485 ('UnicodeFilename', 'UnicodeFilenameFeature'),
4486 ]:
4487 globals()[name] = _CompatabilityThunkFeature(
4488 symbol_versioning.deprecated_in((2, 5, 0)),
4489 'bzrlib.tests', old_name,
4490 new_name, 'bzrlib.tests.features')
44704491
=== modified file 'bzrlib/tests/features.py'
--- bzrlib/tests/features.py 2011-08-23 09:29:27 +0000
+++ bzrlib/tests/features.py 2011-11-21 00:14:24 +0000
@@ -26,7 +26,6 @@
26from bzrlib import (26from bzrlib import (
27 osutils,27 osutils,
28 symbol_versioning,28 symbol_versioning,
29 tests,
30 )29 )
3130
3231
@@ -290,6 +289,8 @@
290 if CaseInsCasePresFilenameFeature.available():289 if CaseInsCasePresFilenameFeature.available():
291 return False290 return False
292291
292 from bzrlib import tests
293
293 if tests.TestCaseWithMemoryTransport.TEST_ROOT is None:294 if tests.TestCaseWithMemoryTransport.TEST_ROOT is None:
294 root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')295 root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
295 tests.TestCaseWithMemoryTransport.TEST_ROOT = root296 tests.TestCaseWithMemoryTransport.TEST_ROOT = root
@@ -490,26 +491,3 @@
490491
491492
492win32_feature = Win32Feature()493win32_feature = Win32Feature()
493
494
495for name in ['HTTPServerFeature',
496 'HTTPSServerFeature', 'SymlinkFeature', 'HardlinkFeature',
497 'OsFifoFeature', 'UnicodeFilenameFeature',
498 'ByteStringNamedFilesystem', 'UTF8Filesystem',
499 'BreakinFeature', 'CaseInsCasePresFilenameFeature',
500 'CaseInsensitiveFilesystemFeature', 'case_sensitive_filesystem_feature',
501 'posix_permissions_feature',
502 ]:
503 setattr(tests, name, _CompatabilityThunkFeature(
504 symbol_versioning.deprecated_in((2, 5, 0)),
505 'bzrlib.tests', name,
506 name, 'bzrlib.tests.features'))
507
508
509for (old_name, new_name) in [
510 ('UnicodeFilename', 'UnicodeFilenameFeature'),
511 ]:
512 setattr(tests, name, _CompatabilityThunkFeature(
513 symbol_versioning.deprecated_in((2, 5, 0)),
514 'bzrlib.tests', old_name,
515 new_name, 'bzrlib.tests.features'))