Merge lp:~vila/bzr/cleanup-deprecations into lp:bzr
- cleanup-deprecations
- Merge into bzr.dev
Status: | Merged |
---|---|
Approved by: | Vincent Ladeuil |
Approved revision: | no longer in the source branch. |
Merged at revision: | 6501 |
Proposed branch: | lp:~vila/bzr/cleanup-deprecations |
Merge into: | lp:bzr |
Diff against target: |
861 lines (+40/-426) 25 files modified
bzrlib/branch.py (+0/-47) bzrlib/bzrdir.py (+0/-14) bzrlib/config.py (+0/-9) bzrlib/hooks.py (+0/-18) bzrlib/inventory.py (+0/-18) bzrlib/merge.py (+0/-66) bzrlib/repofmt/knitrepo.py (+0/-12) bzrlib/store/versioned/__init__.py (+1/-1) bzrlib/tests/per_branch/test_push.py (+0/-5) bzrlib/tests/per_interbranch/test_push.py (+0/-5) bzrlib/tests/per_inventory/basics.py (+0/-4) bzrlib/tests/test_branch.py (+0/-36) bzrlib/tests/test_bzrdir.py (+0/-5) bzrlib/tests/test_config.py (+0/-12) bzrlib/tests/test_hooks.py (+0/-30) bzrlib/tests/test_transform.py (+0/-25) bzrlib/tests/test_workingtree.py (+0/-25) bzrlib/transform.py (+0/-23) bzrlib/transport/__init__.py (+5/-4) bzrlib/transport/ftp/__init__.py (+3/-7) bzrlib/transport/gio_transport.py (+1/-5) bzrlib/transport/local.py (+1/-9) bzrlib/transport/remote.py (+0/-3) bzrlib/workingtree.py (+0/-43) doc/en/release-notes/bzr-2.6.txt (+29/-0) |
To merge this branch: | bzr merge lp:~vila/bzr/cleanup-deprecations |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij (community) | Approve | ||
Review via email: mp+97369@code.launchpad.net |
Commit message
Remove some code deprecated in series older than 2.4 (inclusive)
Description of the change
This removes a bunch of deprecated code (but there is still a fair amount
that I left off the proposal beings already big).
Most of them are described in the news entry, I comment briefly below about
some thoughts I had doing that.
In bzrlib.transport: register_
ignored for years, deleted. Same goes for transport.local where creating a
transport from a non file:/ url has been deprecated almost before I was born
;)
In both ftp.FtpTranspor
which apparently have been duplicated in gio too :-/
I couldn't quickly see what really can be deleted in tuned_gzip and punted,
someone more in the know should probably have lokk there.
Branch.
not trivial to remove as it's still used by tests that can't be simply
removed... this seems to be a bad pattern that deprecated symbols cannot be
simply deleted with their associated tests, this suggests than one symbol
should not be deprecated if it's still used by tests that cover other calls
too or something.
There are other places where this pattern occurs and I think we should be a
bit more strict during reviews as this is better done when the code itself
is deprecated as the submitter has already a good idea about how this code
is used and tested. Doing the same analysis later is far harder and,
overall, not a good use of our collective time.
Vincent Ladeuil (vila) wrote : | # |
> Hmm, that seems odd. As far as I remember Branch.
> by things that actually test Branch.
Thanks ! But I was referring to set_revision_
Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
Preview Diff
1 | === modified file 'bzrlib/branch.py' |
2 | --- bzrlib/branch.py 2012-02-23 23:41:51 +0000 |
3 | +++ bzrlib/branch.py 2012-03-14 14:20:24 +0000 |
4 | @@ -1617,22 +1617,6 @@ |
5 | def __ne__(self, other): |
6 | return not (self == other) |
7 | |
8 | - @classmethod |
9 | - @deprecated_method(deprecated_in((2, 4, 0))) |
10 | - def get_default_format(klass): |
11 | - """Return the current default format.""" |
12 | - return format_registry.get_default() |
13 | - |
14 | - @classmethod |
15 | - @deprecated_method(deprecated_in((2, 4, 0))) |
16 | - def get_formats(klass): |
17 | - """Get all the known formats. |
18 | - |
19 | - Warning: This triggers a load of all lazy registered formats: do not |
20 | - use except when that is desireed. |
21 | - """ |
22 | - return format_registry._get_all() |
23 | - |
24 | def get_reference(self, controldir, name=None): |
25 | """Get the target reference of the branch in controldir. |
26 | |
27 | @@ -1726,21 +1710,6 @@ |
28 | """ |
29 | raise NotImplementedError(self.open) |
30 | |
31 | - @classmethod |
32 | - @deprecated_method(deprecated_in((2, 4, 0))) |
33 | - def register_format(klass, format): |
34 | - """Register a metadir format. |
35 | - |
36 | - See MetaDirBranchFormatFactory for the ability to register a format |
37 | - without loading the code the format needs until it is actually used. |
38 | - """ |
39 | - format_registry.register(format) |
40 | - |
41 | - @classmethod |
42 | - @deprecated_method(deprecated_in((2, 4, 0))) |
43 | - def set_default_format(klass, format): |
44 | - format_registry.set_default(format) |
45 | - |
46 | def supports_set_append_revisions_only(self): |
47 | """True if this format supports set_append_revisions_only.""" |
48 | return False |
49 | @@ -3147,14 +3116,6 @@ |
50 | :ivar tag_updates: A dict with new tags, see BasicTags.merge_to |
51 | """ |
52 | |
53 | - @deprecated_method(deprecated_in((2, 3, 0))) |
54 | - def __int__(self): |
55 | - """Return the relative change in revno. |
56 | - |
57 | - :deprecated: Use `new_revno` and `old_revno` instead. |
58 | - """ |
59 | - return self.new_revno - self.old_revno |
60 | - |
61 | def report(self, to_file): |
62 | tag_conflicts = getattr(self, "tag_conflicts", None) |
63 | tag_updates = getattr(self, "tag_updates", None) |
64 | @@ -3190,14 +3151,6 @@ |
65 | target, otherwise it will be None. |
66 | """ |
67 | |
68 | - @deprecated_method(deprecated_in((2, 3, 0))) |
69 | - def __int__(self): |
70 | - """Return the relative change in revno. |
71 | - |
72 | - :deprecated: Use `new_revno` and `old_revno` instead. |
73 | - """ |
74 | - return self.new_revno - self.old_revno |
75 | - |
76 | def report(self, to_file): |
77 | # TODO: This function gets passed a to_file, but then |
78 | # ignores it and calls note() instead. This is also |
79 | |
80 | === modified file 'bzrlib/bzrdir.py' |
81 | --- bzrlib/bzrdir.py 2012-02-23 23:41:51 +0000 |
82 | +++ bzrlib/bzrdir.py 2012-03-14 14:20:24 +0000 |
83 | @@ -465,10 +465,6 @@ |
84 | stacked=stacked) |
85 | return result |
86 | |
87 | - @deprecated_method(deprecated_in((2, 3, 0))) |
88 | - def generate_backup_name(self, base): |
89 | - return self._available_backup_name(base) |
90 | - |
91 | def _available_backup_name(self, base): |
92 | """Find a non-existing backup file name based on base. |
93 | |
94 | @@ -1234,16 +1230,6 @@ |
95 | """The known .bzr formats.""" |
96 | |
97 | @classmethod |
98 | - @deprecated_method(deprecated_in((2, 4, 0))) |
99 | - def register_bzrdir_format(klass, format): |
100 | - klass.formats.register(format.get_format_string(), format) |
101 | - |
102 | - @classmethod |
103 | - @deprecated_method(deprecated_in((2, 4, 0))) |
104 | - def unregister_bzrdir_format(klass, format): |
105 | - klass.formats.remove(format.get_format_string()) |
106 | - |
107 | - @classmethod |
108 | def probe_transport(klass, transport): |
109 | """Return the .bzrdir style format present in a directory.""" |
110 | try: |
111 | |
112 | === modified file 'bzrlib/config.py' |
113 | --- bzrlib/config.py 2012-03-08 18:30:33 +0000 |
114 | +++ bzrlib/config.py 2012-03-14 14:20:24 +0000 |
115 | @@ -205,11 +205,6 @@ |
116 | """Returns a unique ID for the config.""" |
117 | raise NotImplementedError(self.config_id) |
118 | |
119 | - @deprecated_method(deprecated_in((2, 4, 0))) |
120 | - def get_editor(self): |
121 | - """Get the users pop up editor.""" |
122 | - raise NotImplementedError |
123 | - |
124 | def get_change_editor(self, old_tree, new_tree): |
125 | from bzrlib import diff |
126 | cmd = self._get_change_editor() |
127 | @@ -1056,10 +1051,6 @@ |
128 | conf._create_from_string(str_or_unicode, save) |
129 | return conf |
130 | |
131 | - @deprecated_method(deprecated_in((2, 4, 0))) |
132 | - def get_editor(self): |
133 | - return self._get_user_option('editor') |
134 | - |
135 | @needs_write_lock |
136 | def set_user_option(self, option, value): |
137 | """Save option and its value in the configuration.""" |
138 | |
139 | === modified file 'bzrlib/hooks.py' |
140 | --- bzrlib/hooks.py 2012-01-02 14:41:49 +0000 |
141 | +++ bzrlib/hooks.py 2012-03-14 14:20:24 +0000 |
142 | @@ -106,12 +106,6 @@ |
143 | return pyutils.get_named_object(module_name, member_name) |
144 | |
145 | |
146 | -@symbol_versioning.deprecated_function(symbol_versioning.deprecated_in((2, 3))) |
147 | -def known_hooks_key_to_parent_and_attribute(key): |
148 | - """See KnownHooksRegistry.key_to_parent_and_attribute.""" |
149 | - return known_hooks.key_to_parent_and_attribute(key) |
150 | - |
151 | - |
152 | class Hooks(dict): |
153 | """A dictionary mapping hook name to a list of callables. |
154 | |
155 | @@ -153,18 +147,6 @@ |
156 | deprecated=deprecated, callbacks=callbacks) |
157 | self[name] = hookpoint |
158 | |
159 | - @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4))) |
160 | - def create_hook(self, hook): |
161 | - """Create a hook which can have callbacks registered for it. |
162 | - |
163 | - :param hook: The hook to create. An object meeting the protocol of |
164 | - bzrlib.hooks.HookPoint. It's name is used as the key for future |
165 | - lookups. |
166 | - """ |
167 | - if hook.name in self: |
168 | - raise errors.DuplicateKey(hook.name) |
169 | - self[hook.name] = hook |
170 | - |
171 | def docs(self): |
172 | """Generate the documentation for this Hooks instance. |
173 | |
174 | |
175 | === modified file 'bzrlib/inventory.py' |
176 | --- bzrlib/inventory.py 2012-03-05 17:29:08 +0000 |
177 | +++ bzrlib/inventory.py 2012-03-14 14:20:24 +0000 |
178 | @@ -633,24 +633,6 @@ |
179 | inserted, other than through the Inventory API. |
180 | """ |
181 | |
182 | - @deprecated_method(deprecated_in((2, 4, 0))) |
183 | - def __contains__(self, file_id): |
184 | - """True if this entry contains a file with given id. |
185 | - |
186 | - >>> inv = Inventory() |
187 | - >>> inv.add(InventoryFile('123', 'foo.c', ROOT_ID)) |
188 | - InventoryFile('123', 'foo.c', parent_id='TREE_ROOT', sha1=None, len=None, revision=None) |
189 | - >>> inv.has_id('123') |
190 | - True |
191 | - >>> inv.has_id('456') |
192 | - False |
193 | - |
194 | - Note that this method along with __iter__ are not encouraged for use as |
195 | - they are less clear than specific query methods - they may be rmeoved |
196 | - in the future. |
197 | - """ |
198 | - return self.has_id(file_id) |
199 | - |
200 | def has_filename(self, filename): |
201 | return bool(self.path2id(filename)) |
202 | |
203 | |
204 | === modified file 'bzrlib/merge.py' |
205 | --- bzrlib/merge.py 2012-02-23 19:39:07 +0000 |
206 | +++ bzrlib/merge.py 2012-03-14 14:20:24 +0000 |
207 | @@ -1078,52 +1078,6 @@ |
208 | )) |
209 | return result |
210 | |
211 | - @deprecated_method(deprecated_in((2, 4, 0))) |
212 | - def fix_root(self): |
213 | - if self.tt.final_kind(self.tt.root) is None: |
214 | - self.tt.cancel_deletion(self.tt.root) |
215 | - if self.tt.final_file_id(self.tt.root) is None: |
216 | - self.tt.version_file(self.tt.tree_file_id(self.tt.root), |
217 | - self.tt.root) |
218 | - other_root_file_id = self.other_tree.get_root_id() |
219 | - if other_root_file_id is None: |
220 | - return |
221 | - other_root = self.tt.trans_id_file_id(other_root_file_id) |
222 | - if other_root == self.tt.root: |
223 | - return |
224 | - if self.this_tree.has_id( |
225 | - self.other_tree.get_root_id()): |
226 | - # the other tree's root is a non-root in the current tree (as |
227 | - # when a previously unrelated branch is merged into another) |
228 | - return |
229 | - if self.tt.final_kind(other_root) is not None: |
230 | - other_root_is_present = True |
231 | - else: |
232 | - # other_root doesn't have a physical representation. We still need |
233 | - # to move any references to the actual root of the tree. |
234 | - other_root_is_present = False |
235 | - # the other tree root is not present in this tree. We are |
236 | - # calling adjust_path for children which *want* to be present with a |
237 | - # correct place to go. |
238 | - for child_id in self.other_tree.iter_children( |
239 | - self.other_tree.get_root_id()): |
240 | - trans_id = self.tt.trans_id_file_id(child_id) |
241 | - if not other_root_is_present: |
242 | - if self.tt.final_kind(trans_id) is not None: |
243 | - # The item exist in the final tree and has a defined place |
244 | - # to go already. |
245 | - continue |
246 | - # Move the item into the root |
247 | - try: |
248 | - final_name = self.tt.final_name(trans_id) |
249 | - except errors.NoFinalPath: |
250 | - # This file is not present anymore, ignore it. |
251 | - continue |
252 | - self.tt.adjust_path(final_name, self.tt.root, trans_id) |
253 | - if other_root_is_present: |
254 | - self.tt.cancel_creation(other_root) |
255 | - self.tt.cancel_versioning(other_root) |
256 | - |
257 | def write_modified(self, results): |
258 | modified_hashes = {} |
259 | for path in results.modified_paths: |
260 | @@ -1239,26 +1193,6 @@ |
261 | # At this point, the lcas disagree, and the tip disagree |
262 | return 'conflict' |
263 | |
264 | - @staticmethod |
265 | - @deprecated_method(deprecated_in((2, 2, 0))) |
266 | - def scalar_three_way(this_tree, base_tree, other_tree, file_id, key): |
267 | - """Do a three-way test on a scalar. |
268 | - Return "this", "other" or "conflict", depending whether a value wins. |
269 | - """ |
270 | - key_base = key(base_tree, file_id) |
271 | - key_other = key(other_tree, file_id) |
272 | - #if base == other, either they all agree, or only THIS has changed. |
273 | - if key_base == key_other: |
274 | - return "this" |
275 | - key_this = key(this_tree, file_id) |
276 | - # "Ambiguous clean merge" |
277 | - if key_this == key_other: |
278 | - return "this" |
279 | - elif key_this == key_base: |
280 | - return "other" |
281 | - else: |
282 | - return "conflict" |
283 | - |
284 | def merge_names(self, file_id): |
285 | def get_entry(tree): |
286 | try: |
287 | |
288 | === modified file 'bzrlib/repofmt/knitrepo.py' |
289 | --- bzrlib/repofmt/knitrepo.py 2012-02-23 19:45:15 +0000 |
290 | +++ bzrlib/repofmt/knitrepo.py 2012-03-14 14:20:24 +0000 |
291 | @@ -488,21 +488,9 @@ |
292 | |
293 | @needs_read_lock |
294 | def search_missing_revision_ids(self, |
295 | - revision_id=symbol_versioning.DEPRECATED_PARAMETER, |
296 | find_ghosts=True, revision_ids=None, if_present_ids=None, |
297 | limit=None): |
298 | """See InterRepository.search_missing_revision_ids().""" |
299 | - if symbol_versioning.deprecated_passed(revision_id): |
300 | - symbol_versioning.warn( |
301 | - 'search_missing_revision_ids(revision_id=...) was ' |
302 | - 'deprecated in 2.4. Use revision_ids=[...] instead.', |
303 | - DeprecationWarning, stacklevel=2) |
304 | - if revision_ids is not None: |
305 | - raise AssertionError( |
306 | - 'revision_ids is mutually exclusive with revision_id') |
307 | - if revision_id is not None: |
308 | - revision_ids = [revision_id] |
309 | - del revision_id |
310 | source_ids_set = self._present_source_revisions_for( |
311 | revision_ids, if_present_ids) |
312 | # source_ids is the worst possible case we may need to pull. |
313 | |
314 | === modified file 'bzrlib/store/versioned/__init__.py' |
315 | --- bzrlib/store/versioned/__init__.py 2011-12-18 15:28:38 +0000 |
316 | +++ bzrlib/store/versioned/__init__.py 2012-03-14 14:20:24 +0000 |
317 | @@ -219,7 +219,7 @@ |
318 | "is deprecated. Please provide a to_transaction.", |
319 | DeprecationWarning, |
320 | stacklevel=2) |
321 | - # we are copying single objects, and there may be open tranasactions |
322 | + # we are copying single objects, and there may be open transactions |
323 | # so again with the passthrough |
324 | to_transaction = PassThroughTransaction() |
325 | pb = bzrlib.ui.ui_factory.nested_progress_bar() |
326 | |
327 | === modified file 'bzrlib/tests/per_branch/test_push.py' |
328 | --- bzrlib/tests/per_branch/test_push.py 2012-02-23 23:26:35 +0000 |
329 | +++ bzrlib/tests/per_branch/test_push.py 2012-03-14 14:20:24 +0000 |
330 | @@ -57,11 +57,6 @@ |
331 | # result object contains some structured data |
332 | self.assertEqual(result.old_revid, 'M1') |
333 | self.assertEqual(result.new_revid, 'P2') |
334 | - # and it can be treated as an integer for compatibility |
335 | - self.assertEqual(self.applyDeprecated( |
336 | - symbol_versioning.deprecated_in((2, 3, 0)), |
337 | - result.__int__), |
338 | - 0) |
339 | |
340 | def test_push_merged_indirect(self): |
341 | # it should be possible to do a push from one branch into another |
342 | |
343 | === modified file 'bzrlib/tests/per_interbranch/test_push.py' |
344 | --- bzrlib/tests/per_interbranch/test_push.py 2012-02-23 23:26:35 +0000 |
345 | +++ bzrlib/tests/per_interbranch/test_push.py 2012-03-14 14:20:24 +0000 |
346 | @@ -64,11 +64,6 @@ |
347 | # result object contains some structured data |
348 | self.assertEqual(result.old_revid, 'M1') |
349 | self.assertEqual(result.new_revid, 'P2') |
350 | - # and it can be treated as an integer for compatibility |
351 | - self.assertEqual(self.applyDeprecated( |
352 | - symbol_versioning.deprecated_in((2, 3, 0)), |
353 | - result.__int__), |
354 | - 0) |
355 | |
356 | def test_push_merged_indirect(self): |
357 | # it should be possible to do a push from one branch into another |
358 | |
359 | === modified file 'bzrlib/tests/per_inventory/basics.py' |
360 | --- bzrlib/tests/per_inventory/basics.py 2011-06-14 02:21:41 +0000 |
361 | +++ bzrlib/tests/per_inventory/basics.py 2012-03-14 14:20:24 +0000 |
362 | @@ -152,10 +152,6 @@ |
363 | inv = self.inv_to_test_inv(inv) |
364 | self.assertEqual(inv.path2id('src'), 'src-id') |
365 | self.assertEqual(inv.path2id('src/bye.c'), 'bye-id') |
366 | - self.assertTrue( |
367 | - self.applyDeprecated( |
368 | - deprecated_in((2, 4, 0)), |
369 | - inv.__contains__, 'src-id')) |
370 | |
371 | def test_non_directory_children(self): |
372 | """Test path2id when a parent directory has no children""" |
373 | |
374 | === modified file 'bzrlib/tests/test_branch.py' |
375 | --- bzrlib/tests/test_branch.py 2012-03-08 16:23:53 +0000 |
376 | +++ bzrlib/tests/test_branch.py 2012-03-14 14:20:24 +0000 |
377 | @@ -228,29 +228,6 @@ |
378 | branch = _mod_branch.Branch.open('.') |
379 | self.assertEquals(branch._format.features, {}) |
380 | |
381 | - def test_register_unregister_format(self): |
382 | - # Test the deprecated format registration functions |
383 | - format = SampleBranchFormat() |
384 | - # make a control dir |
385 | - dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url()) |
386 | - # make a branch |
387 | - format.initialize(dir) |
388 | - # register a format for it. |
389 | - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
390 | - _mod_branch.BranchFormat.register_format, format) |
391 | - # which branch.Open will refuse (not supported) |
392 | - self.assertRaises(errors.UnsupportedFormatError, |
393 | - _mod_branch.Branch.open, self.get_url()) |
394 | - self.make_branch_and_tree('foo') |
395 | - # but open_downlevel will work |
396 | - self.assertEqual( |
397 | - format.open(dir), |
398 | - controldir.ControlDir.open(self.get_url()).open_branch(unsupported=True)) |
399 | - # unregister the format |
400 | - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
401 | - _mod_branch.BranchFormat.unregister_format, format) |
402 | - self.make_branch_and_tree('bar') |
403 | - |
404 | |
405 | class TestBranchFormatRegistry(tests.TestCase): |
406 | |
407 | @@ -736,19 +713,6 @@ |
408 | |
409 | class TestPullResult(tests.TestCase): |
410 | |
411 | - def test_pull_result_to_int(self): |
412 | - # to support old code, the pull result can be used as an int |
413 | - r = _mod_branch.PullResult() |
414 | - r.old_revno = 10 |
415 | - r.new_revno = 20 |
416 | - # this usage of results is not recommended for new code (because it |
417 | - # doesn't describe very well what happened), but for api stability |
418 | - # it's still supported |
419 | - self.assertEqual(self.applyDeprecated( |
420 | - symbol_versioning.deprecated_in((2, 3, 0)), |
421 | - r.__int__), |
422 | - 10) |
423 | - |
424 | def test_report_changed(self): |
425 | r = _mod_branch.PullResult() |
426 | r.old_revid = "old-revid" |
427 | |
428 | === modified file 'bzrlib/tests/test_bzrdir.py' |
429 | --- bzrlib/tests/test_bzrdir.py 2012-02-23 23:26:35 +0000 |
430 | +++ bzrlib/tests/test_bzrdir.py 2012-03-14 14:20:24 +0000 |
431 | @@ -1404,11 +1404,6 @@ |
432 | possible_transports=[self._transport]) |
433 | self._bzrdir = bzrdir.BzrDir.open_from_transport(self._transport) |
434 | |
435 | - def test_deprecated_generate_backup_name(self): |
436 | - res = self.applyDeprecated( |
437 | - symbol_versioning.deprecated_in((2, 3, 0)), |
438 | - self._bzrdir.generate_backup_name, 'whatever') |
439 | - |
440 | def test_new(self): |
441 | self.assertEqual("a.~1~", self._bzrdir._available_backup_name("a")) |
442 | |
443 | |
444 | === modified file 'bzrlib/tests/test_config.py' |
445 | --- bzrlib/tests/test_config.py 2012-03-08 18:30:33 +0000 |
446 | +++ bzrlib/tests/test_config.py 2012-03-14 14:20:24 +0000 |
447 | @@ -476,12 +476,6 @@ |
448 | def test_constructs(self): |
449 | config.Config() |
450 | |
451 | - def test_no_default_editor(self): |
452 | - self.assertRaises( |
453 | - NotImplementedError, |
454 | - self.applyDeprecated, deprecated_in((2, 4, 0)), |
455 | - config.Config().get_editor) |
456 | - |
457 | def test_user_email(self): |
458 | my_config = InstrumentedConfig() |
459 | self.assertEqual('robert.collins@example.org', my_config.user_email()) |
460 | @@ -1189,12 +1183,6 @@ |
461 | my_config = config.GlobalConfig() |
462 | self.assertEqual(None, my_config._get_user_id()) |
463 | |
464 | - def test_configured_editor(self): |
465 | - my_config = config.GlobalConfig.from_string(sample_config_text) |
466 | - editor = self.applyDeprecated( |
467 | - deprecated_in((2, 4, 0)), my_config.get_editor) |
468 | - self.assertEqual('vim', editor) |
469 | - |
470 | def test_signatures_always(self): |
471 | my_config = config.GlobalConfig.from_string(sample_always_signatures) |
472 | self.assertEqual(config.CHECK_NEVER, |
473 | |
474 | === modified file 'bzrlib/tests/test_hooks.py' |
475 | --- bzrlib/tests/test_hooks.py 2012-01-02 14:41:49 +0000 |
476 | +++ bzrlib/tests/test_hooks.py 2012-03-14 14:20:24 +0000 |
477 | @@ -29,7 +29,6 @@ |
478 | install_lazy_named_hook, |
479 | known_hooks, |
480 | known_hooks_key_to_object, |
481 | - known_hooks_key_to_parent_and_attribute, |
482 | ) |
483 | from bzrlib.symbol_versioning import ( |
484 | deprecated_in, |
485 | @@ -38,25 +37,6 @@ |
486 | |
487 | class TestHooks(tests.TestCase): |
488 | |
489 | - def test_create_hook_first(self): |
490 | - hooks = Hooks("bzrlib.tests.test_hooks", "some_hooks") |
491 | - doc = ("Invoked after changing the tip of a branch object. Called with" |
492 | - "a bzrlib.branch.PostChangeBranchTipParams object") |
493 | - hook = HookPoint("post_tip_change", doc, (0, 15), None) |
494 | - self.applyDeprecated(deprecated_in((2, 4)), hooks.create_hook, hook) |
495 | - self.assertEqual(hook, hooks['post_tip_change']) |
496 | - |
497 | - def test_create_hook_name_collision_errors(self): |
498 | - hooks = Hooks("bzrlib.tests.test_hooks", "some_hooks") |
499 | - doc = ("Invoked after changing the tip of a branch object. Called with" |
500 | - "a bzrlib.branch.PostChangeBranchTipParams object") |
501 | - hook = HookPoint("post_tip_change", doc, (0, 15), None) |
502 | - hook2 = HookPoint("post_tip_change", None, None, None) |
503 | - self.applyDeprecated(deprecated_in((2, 4)), hooks.create_hook, hook) |
504 | - self.assertRaises(errors.DuplicateKey, self.applyDeprecated, |
505 | - deprecated_in((2, 4, 0)), hooks.create_hook, hook2) |
506 | - self.assertEqual(hook, hooks['post_tip_change']) |
507 | - |
508 | def test_docs(self): |
509 | """docs() should return something reasonable about the Hooks.""" |
510 | class MyHooks(Hooks): |
511 | @@ -286,16 +266,6 @@ |
512 | self.assertIs(branch.Branch.hooks, |
513 | known_hooks_key_to_object(('bzrlib.branch', 'Branch.hooks'))) |
514 | |
515 | - def test_known_hooks_key_to_parent_and_attribute_deprecated(self): |
516 | - self.assertEqual((branch.Branch, 'hooks'), |
517 | - self.applyDeprecated(deprecated_in((2,3)), |
518 | - known_hooks_key_to_parent_and_attribute, |
519 | - ('bzrlib.branch', 'Branch.hooks'))) |
520 | - self.assertEqual((branch, 'Branch'), |
521 | - self.applyDeprecated(deprecated_in((2,3)), |
522 | - known_hooks_key_to_parent_and_attribute, |
523 | - ('bzrlib.branch', 'Branch'))) |
524 | - |
525 | def test_known_hooks_key_to_parent_and_attribute(self): |
526 | self.assertEqual((branch.Branch, 'hooks'), |
527 | known_hooks.key_to_parent_and_attribute( |
528 | |
529 | === modified file 'bzrlib/tests/test_transform.py' |
530 | --- bzrlib/tests/test_transform.py 2012-02-23 23:26:35 +0000 |
531 | +++ bzrlib/tests/test_transform.py 2012-03-14 14:20:24 +0000 |
532 | @@ -2410,31 +2410,6 @@ |
533 | self.assertEqual('tree', revision.properties['branch-nick']) |
534 | |
535 | |
536 | -class TestBackupName(tests.TestCase): |
537 | - |
538 | - def test_deprecations(self): |
539 | - class MockTransform(object): |
540 | - |
541 | - def has_named_child(self, by_parent, parent_id, name): |
542 | - return name in by_parent.get(parent_id, []) |
543 | - |
544 | - class MockEntry(object): |
545 | - |
546 | - def __init__(self): |
547 | - object.__init__(self) |
548 | - self.name = "name" |
549 | - |
550 | - tt = MockTransform() |
551 | - name1 = self.applyDeprecated( |
552 | - symbol_versioning.deprecated_in((2, 3, 0)), |
553 | - transform.get_backup_name, MockEntry(), {'a':[]}, 'a', tt) |
554 | - self.assertEqual('name.~1~', name1) |
555 | - name2 = self.applyDeprecated( |
556 | - symbol_versioning.deprecated_in((2, 3, 0)), |
557 | - transform._get_backup_name, 'name', {'a':['name.~1~']}, 'a', tt) |
558 | - self.assertEqual('name.~2~', name2) |
559 | - |
560 | - |
561 | class TestFileMover(tests.TestCaseWithTransport): |
562 | |
563 | def test_file_mover(self): |
564 | |
565 | === modified file 'bzrlib/tests/test_workingtree.py' |
566 | --- bzrlib/tests/test_workingtree.py 2011-12-22 19:54:56 +0000 |
567 | +++ bzrlib/tests/test_workingtree.py 2012-03-14 14:20:24 +0000 |
568 | @@ -218,31 +218,6 @@ |
569 | workingtree.WorkingTreeFormatMetaDir.find_format, |
570 | dir) |
571 | |
572 | - def test_register_unregister_format(self): |
573 | - format = SampleTreeFormat() |
574 | - # make a control dir |
575 | - dir = bzrdir.BzrDirMetaFormat1().initialize('.') |
576 | - dir.create_repository() |
577 | - dir.create_branch() |
578 | - # make a branch |
579 | - format.initialize(dir) |
580 | - # register a format for it. |
581 | - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
582 | - workingtree.WorkingTreeFormat.register_format, format) |
583 | - self.assertTrue(format in |
584 | - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
585 | - workingtree.WorkingTreeFormat.get_formats)) |
586 | - # which branch.Open will refuse (not supported) |
587 | - self.assertRaises(errors.UnsupportedFormatError, workingtree.WorkingTree.open, '.') |
588 | - # but open_downlevel will work |
589 | - self.assertEqual(format.open(dir), workingtree.WorkingTree.open_downlevel('.')) |
590 | - # unregister the format |
591 | - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
592 | - workingtree.WorkingTreeFormat.unregister_format, format) |
593 | - self.assertFalse(format in |
594 | - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
595 | - workingtree.WorkingTreeFormat.get_formats)) |
596 | - |
597 | def test_find_format_with_features(self): |
598 | tree = self.make_branch_and_tree('.', format='2a') |
599 | tree.update_feature_flags({"name": "necessity"}) |
600 | |
601 | === modified file 'bzrlib/transform.py' |
602 | --- bzrlib/transform.py 2012-03-05 17:29:08 +0000 |
603 | +++ bzrlib/transform.py 2012-03-14 14:20:24 +0000 |
604 | @@ -575,11 +575,6 @@ |
605 | # ensure that all children are registered with the transaction |
606 | list(self.iter_tree_children(parent_id)) |
607 | |
608 | - @deprecated_method(deprecated_in((2, 3, 0))) |
609 | - def has_named_child(self, by_parent, parent_id, name): |
610 | - return self._has_named_child( |
611 | - name, parent_id, known_children=by_parent.get(parent_id, [])) |
612 | - |
613 | def _has_named_child(self, name, parent_id, known_children): |
614 | """Does a parent already have a name child. |
615 | |
616 | @@ -2829,24 +2824,6 @@ |
617 | tt.set_executability(entry.executable, trans_id) |
618 | |
619 | |
620 | -@deprecated_function(deprecated_in((2, 3, 0))) |
621 | -def get_backup_name(entry, by_parent, parent_trans_id, tt): |
622 | - return _get_backup_name(entry.name, by_parent, parent_trans_id, tt) |
623 | - |
624 | - |
625 | -@deprecated_function(deprecated_in((2, 3, 0))) |
626 | -def _get_backup_name(name, by_parent, parent_trans_id, tt): |
627 | - """Produce a backup-style name that appears to be available""" |
628 | - def name_gen(): |
629 | - counter = 1 |
630 | - while True: |
631 | - yield "%s.~%d~" % (name, counter) |
632 | - counter += 1 |
633 | - for new_name in name_gen(): |
634 | - if not tt.has_named_child(by_parent, parent_trans_id, new_name): |
635 | - return new_name |
636 | - |
637 | - |
638 | def revert(working_tree, target_tree, filenames, backups=False, |
639 | pb=None, change_reporter=None): |
640 | """Revert a working tree's contents to those of a target tree.""" |
641 | |
642 | === modified file 'bzrlib/transport/__init__.py' |
643 | --- bzrlib/transport/__init__.py 2012-01-28 12:47:17 +0000 |
644 | +++ bzrlib/transport/__init__.py 2012-03-14 14:20:24 +0000 |
645 | @@ -138,10 +138,11 @@ |
646 | def register_lazy_transport(prefix, module, classname): |
647 | if not prefix in transport_list_registry: |
648 | register_transport_proto(prefix) |
649 | - transport_list_registry.register_lazy_transport_provider(prefix, module, classname) |
650 | - |
651 | - |
652 | -def register_transport(prefix, klass, override=DEPRECATED_PARAMETER): |
653 | + transport_list_registry.register_lazy_transport_provider( |
654 | + prefix, module, classname) |
655 | + |
656 | + |
657 | +def register_transport(prefix, klass): |
658 | if not prefix in transport_list_registry: |
659 | register_transport_proto(prefix) |
660 | transport_list_registry.register_transport_provider(prefix, klass) |
661 | |
662 | === modified file 'bzrlib/transport/ftp/__init__.py' |
663 | --- bzrlib/transport/ftp/__init__.py 2011-12-19 13:23:58 +0000 |
664 | +++ bzrlib/transport/ftp/__init__.py 2012-03-14 14:20:24 +0000 |
665 | @@ -248,7 +248,7 @@ |
666 | mutter("FTP has not: %s: %s", abspath, e) |
667 | return False |
668 | |
669 | - def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0): |
670 | + def get(self, relpath, retries=0): |
671 | """Get the file at the given relative path. |
672 | |
673 | :param relpath: The relative path to the file |
674 | @@ -258,10 +258,6 @@ |
675 | We're meant to return a file-like object which bzr will |
676 | then read from. For now we do this via the magic of StringIO |
677 | """ |
678 | - if deprecated_passed(decode): |
679 | - warn(deprecated_in((2,3,0)) % |
680 | - '"decode" parameter to FtpTransport.get()', |
681 | - DeprecationWarning, stacklevel=2) |
682 | try: |
683 | mutter("FTP get: %s", self._remote_path(relpath)) |
684 | f = self._get_FTP() |
685 | @@ -279,7 +275,7 @@ |
686 | else: |
687 | warning("FTP temporary error: %s. Retrying.", str(e)) |
688 | self._reconnect() |
689 | - return self.get(relpath, decode, retries+1) |
690 | + return self.get(relpath, retries+1) |
691 | except EOFError, e: |
692 | if retries > _number_of_retries: |
693 | raise errors.TransportError("FTP control connection closed during GET %s." |
694 | @@ -289,7 +285,7 @@ |
695 | warning("FTP control connection closed. Trying to reopen.") |
696 | time.sleep(_sleep_between_retries) |
697 | self._reconnect() |
698 | - return self.get(relpath, decode, retries+1) |
699 | + return self.get(relpath, retries+1) |
700 | |
701 | def put_file(self, relpath, fp, mode=None, retries=0): |
702 | """Copy the file-like or string object into the location. |
703 | |
704 | === modified file 'bzrlib/transport/gio_transport.py' |
705 | --- bzrlib/transport/gio_transport.py 2011-12-19 13:23:58 +0000 |
706 | +++ bzrlib/transport/gio_transport.py 2012-03-14 14:20:24 +0000 |
707 | @@ -271,7 +271,7 @@ |
708 | else: |
709 | self._translate_gio_error(e, relpath) |
710 | |
711 | - def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0): |
712 | + def get(self, relpath, retries=0): |
713 | """Get the file at the given relative path. |
714 | |
715 | :param relpath: The relative path to the file |
716 | @@ -281,10 +281,6 @@ |
717 | We're meant to return a file-like object which bzr will |
718 | then read from. For now we do this via the magic of StringIO |
719 | """ |
720 | - if deprecated_passed(decode): |
721 | - warn(deprecated_in((2,3,0)) % |
722 | - '"decode" parameter to GioTransport.get()', |
723 | - DeprecationWarning, stacklevel=2) |
724 | try: |
725 | if 'gio' in debug.debug_flags: |
726 | mutter("GIO get: %s" % relpath) |
727 | |
728 | === modified file 'bzrlib/transport/local.py' |
729 | --- bzrlib/transport/local.py 2011-12-18 12:46:49 +0000 |
730 | +++ bzrlib/transport/local.py 2012-03-14 14:20:24 +0000 |
731 | @@ -52,15 +52,7 @@ |
732 | def __init__(self, base): |
733 | """Set the base path where files will be stored.""" |
734 | if not base.startswith('file://'): |
735 | - symbol_versioning.warn( |
736 | - "Instantiating LocalTransport with a filesystem path" |
737 | - " is deprecated as of bzr 0.8." |
738 | - " Please use bzrlib.transport.get_transport()" |
739 | - " or pass in a file:// url.", |
740 | - DeprecationWarning, |
741 | - stacklevel=2 |
742 | - ) |
743 | - base = urlutils.local_path_to_url(base) |
744 | + raise AssertionError("not a file:// url: %r" % base) |
745 | if base[-1] != '/': |
746 | base = base + '/' |
747 | |
748 | |
749 | === modified file 'bzrlib/transport/remote.py' |
750 | --- bzrlib/transport/remote.py 2011-12-30 14:19:53 +0000 |
751 | +++ bzrlib/transport/remote.py 2012-03-14 14:20:24 +0000 |
752 | @@ -36,9 +36,6 @@ |
753 | urlutils, |
754 | ) |
755 | from bzrlib.smart import client, medium |
756 | -from bzrlib.symbol_versioning import ( |
757 | - deprecated_method, |
758 | - ) |
759 | |
760 | |
761 | class _SmartStat(object): |
762 | |
763 | === modified file 'bzrlib/workingtree.py' |
764 | --- bzrlib/workingtree.py 2012-02-17 16:39:09 +0000 |
765 | +++ bzrlib/workingtree.py 2012-03-14 14:20:24 +0000 |
766 | @@ -3078,13 +3078,6 @@ |
767 | def __ne__(self, other): |
768 | return not (self == other) |
769 | |
770 | - @classmethod |
771 | - @symbol_versioning.deprecated_method( |
772 | - symbol_versioning.deprecated_in((2, 4, 0))) |
773 | - def get_default_format(klass): |
774 | - """Return the current default format.""" |
775 | - return format_registry.get_default() |
776 | - |
777 | def get_format_description(self): |
778 | """Return the short description for this format.""" |
779 | raise NotImplementedError(self.get_format_description) |
780 | @@ -3106,42 +3099,6 @@ |
781 | """True if this format supports stored views.""" |
782 | return False |
783 | |
784 | - @classmethod |
785 | - @symbol_versioning.deprecated_method( |
786 | - symbol_versioning.deprecated_in((2, 4, 0))) |
787 | - def register_format(klass, format): |
788 | - format_registry.register(format) |
789 | - |
790 | - @classmethod |
791 | - @symbol_versioning.deprecated_method( |
792 | - symbol_versioning.deprecated_in((2, 4, 0))) |
793 | - def register_extra_format(klass, format): |
794 | - format_registry.register_extra(format) |
795 | - |
796 | - @classmethod |
797 | - @symbol_versioning.deprecated_method( |
798 | - symbol_versioning.deprecated_in((2, 4, 0))) |
799 | - def unregister_extra_format(klass, format): |
800 | - format_registry.unregister_extra(format) |
801 | - |
802 | - @classmethod |
803 | - @symbol_versioning.deprecated_method( |
804 | - symbol_versioning.deprecated_in((2, 4, 0))) |
805 | - def get_formats(klass): |
806 | - return format_registry._get_all() |
807 | - |
808 | - @classmethod |
809 | - @symbol_versioning.deprecated_method( |
810 | - symbol_versioning.deprecated_in((2, 4, 0))) |
811 | - def set_default_format(klass, format): |
812 | - format_registry.set_default(format) |
813 | - |
814 | - @classmethod |
815 | - @symbol_versioning.deprecated_method( |
816 | - symbol_versioning.deprecated_in((2, 4, 0))) |
817 | - def unregister_format(klass, format): |
818 | - format_registry.remove(format) |
819 | - |
820 | def get_controldir_for_branch(self): |
821 | """Get the control directory format for creating branches. |
822 | |
823 | |
824 | === modified file 'doc/en/release-notes/bzr-2.6.txt' |
825 | --- doc/en/release-notes/bzr-2.6.txt 2012-03-14 10:29:44 +0000 |
826 | +++ doc/en/release-notes/bzr-2.6.txt 2012-03-14 14:20:24 +0000 |
827 | @@ -91,6 +91,35 @@ |
828 | * New convenience API method ``WorkingTree.get_config_stack``. |
829 | (Jelmer Vernooij) |
830 | |
831 | +* Remove |
832 | + ``branch.PullResult.__int__`` deprecated in 2.3.0, |
833 | + ``branch.PushResult.__int__`` deprecated in 2.3.0, |
834 | + ``branch.BranchFormat.get_default_format`` deprecated in 2.4.0, |
835 | + ``branch.BranchFormat.get_formats`` deprecated in 2.4.0, |
836 | + ``branch.BranchFormat.set_default_format`` deprecated in 2.4.0, |
837 | + ``branch.BranchFormat.register_format`` deprecated in 2.4.0, |
838 | + ``branch.BranchFormat.unregister_format`` deprecated in 2.4.0, |
839 | + ``bzrdir.BzrDir.generate_backup_name`` deprecated in 2.3.0, |
840 | + ``bzrdir.BzrProber.register_bzrdir_format`` deprecated in 2.4.0, |
841 | + ``bzrdir.BzrProber.unregister_bzrdir_format`` deprecated in 2.4.0, |
842 | + ``config.Config.get_editor`` deprecated in 2.4.0, |
843 | + ``hooks.known_hooks_key_to_parent_and_attribute`` deprecated in 2.3, |
844 | + ``hooks.Hooks.create_hook`` deprecated in 2.4, |
845 | + ``inventory.Inventory.__contains__`` deprecated in 2.4.0, |
846 | + ``merge.Merge3Merger.scalar_three_way`` deprecated in 2.2.0, |
847 | + ``merge.Merge3Merger.fix_root`` deprecated in 2.4.0, |
848 | + ``transform.TreeTransformBase.has_named_child`` deprecated in 2.3.0, |
849 | + ``transform.get_backup_name`` deprecated in 2.3.0, |
850 | + ``transform._get_backup_name`` deprecated in 2.3.0, |
851 | + ``workingtree.WorkingTreeFormat.get_default_format`` deprecated in 2.4.0, |
852 | + ``workingtree.WorkingTreeFormat.register_format`` deprecated in 2.4.0, |
853 | + ``workingtree.WorkingTreeFormat.register_extra_format`` deprecated in 2.4.0, |
854 | + ``workingtree.WorkingTreeFormat.unregister_extra_format`` deprecated in 2.4.0, |
855 | + ``workingtree.WorkingTreeFormat.get_formats`` deprecated in 2.4.0, |
856 | + ``workingtree.WorkingTreeFormat.set_default_format`` deprecated in 2.4.0, |
857 | + ``workingtree.WorkingTreeFormat.unregister_format`` deprecated in 2.4.0, |
858 | + (Vincent Ladeuil) |
859 | + |
860 | Internals |
861 | ********* |
862 |
Looks good. Nice to finally get rid of this cruft. :-)
> Branch. set_revision_ history (as well as Branch. import_ last_revision_ info) is revision_ history is only used by things that actually test Branch. revision_ history. I'll look into it.
> not trivial to remove as it's still used by tests that can't be simply
> removed... this seems to be a bad pattern that deprecated symbols cannot be
> simply deleted with their associated tests, this suggests than one symbol
> should not be deprecated if it's still used by tests that cover other calls
> too or something.
Hmm, that seems odd. As far as I remember Branch.