Merge lp://staging/~mbp/bzr/deprecation-old into lp://staging/~bzr/bzr/trunk-old
- deprecation-old
- Merge into trunk-old
Proposed by
Martin Pool
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp://staging/~mbp/bzr/deprecation-old |
Merge into: | lp://staging/~bzr/bzr/trunk-old |
Diff against target: | 1229 lines |
To merge this branch: | bzr merge lp://staging/~mbp/bzr/deprecation-old |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel | Approve | ||
Review via email: mp+4432@code.staging.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote : | # |
Revision history for this message
John A Meinel (jameinel) : | # |
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-03-23 16:12:27 +0000 |
3 | +++ NEWS 2009-03-23 21:35:11 +0000 |
4 | @@ -124,6 +124,9 @@ |
5 | API Changes |
6 | *********** |
7 | |
8 | +* APIs deprecated in 1.6 and previous verisons of bzr are now removed. |
9 | + (Martin Pool) |
10 | + |
11 | * New API ``Inventory.filter()`` added that filters an inventory by |
12 | a set of file-ids so that only those fileids, their parents and |
13 | their children are included. (Ian Clatworthy) |
14 | |
15 | === modified file 'bzrlib/bzrdir.py' |
16 | --- bzrlib/bzrdir.py 2009-03-19 04:08:21 +0000 |
17 | +++ bzrlib/bzrdir.py 2009-03-23 21:35:11 +0000 |
18 | @@ -2470,11 +2470,6 @@ |
19 | self.snapshot_ie(previous_entries, ie, w, rev_id) |
20 | del ie.text_id |
21 | |
22 | - @symbol_versioning.deprecated_method(symbol_versioning.one_one) |
23 | - def get_parents(self, revision_ids): |
24 | - for revision_id in revision_ids: |
25 | - yield self.revisions[revision_id].parent_ids |
26 | - |
27 | def get_parent_map(self, revision_ids): |
28 | """See graph._StackedParentsProvider.get_parent_map""" |
29 | return dict((revision_id, self.revisions[revision_id]) |
30 | |
31 | === modified file 'bzrlib/diff.py' |
32 | --- bzrlib/diff.py 2009-02-25 13:25:14 +0000 |
33 | +++ bzrlib/diff.py 2009-03-23 21:35:11 +0000 |
34 | @@ -41,9 +41,8 @@ |
35 | """) |
36 | |
37 | from bzrlib.symbol_versioning import ( |
38 | - deprecated_function, |
39 | - one_three |
40 | - ) |
41 | + deprecated_function, |
42 | + ) |
43 | from bzrlib.trace import mutter, note, warning |
44 | |
45 | |
46 | @@ -441,13 +440,6 @@ |
47 | return timestamp.format_patch_date(mtime) |
48 | |
49 | |
50 | -@deprecated_function(one_three) |
51 | -def get_prop_change(meta_modified): |
52 | - if meta_modified: |
53 | - return " (properties changed)" |
54 | - else: |
55 | - return "" |
56 | - |
57 | def get_executable_change(old_is_x, new_is_x): |
58 | descr = { True:"+x", False:"-x", None:"??" } |
59 | if old_is_x != new_is_x: |
60 | |
61 | === modified file 'bzrlib/errors.py' |
62 | --- bzrlib/errors.py 2009-03-12 13:03:16 +0000 |
63 | +++ bzrlib/errors.py 2009-03-23 21:35:11 +0000 |
64 | @@ -2309,15 +2309,6 @@ |
65 | self.transport = transport |
66 | |
67 | |
68 | -class NoSmartServer(NotBranchError): |
69 | - |
70 | - _fmt = "No smart server available at %(url)s" |
71 | - |
72 | - @symbol_versioning.deprecated_method(symbol_versioning.one_four) |
73 | - def __init__(self, url): |
74 | - self.url = url |
75 | - |
76 | - |
77 | class UnknownSSH(BzrError): |
78 | |
79 | _fmt = "Unrecognised value for BZR_SSH environment variable: %(vendor)s" |
80 | |
81 | === modified file 'bzrlib/graph.py' |
82 | --- bzrlib/graph.py 2009-03-17 06:18:16 +0000 |
83 | +++ bzrlib/graph.py 2009-03-23 21:35:11 +0000 |
84 | @@ -600,24 +600,6 @@ |
85 | all_unique_searcher._iterations) |
86 | unique_tip_searchers = next_unique_searchers |
87 | |
88 | - @symbol_versioning.deprecated_method(symbol_versioning.one_one) |
89 | - def get_parents(self, revisions): |
90 | - """Find revision ids of the parents of a list of revisions |
91 | - |
92 | - A list is returned of the same length as the input. Each entry |
93 | - is a list of parent ids for the corresponding input revision. |
94 | - |
95 | - [NULL_REVISION] is used as the parent of the first user-committed |
96 | - revision. Its parent list is empty. |
97 | - |
98 | - If the revision is not present (i.e. a ghost), None is used in place |
99 | - of the list of parents. |
100 | - |
101 | - Deprecated in bzr 1.2 - please see get_parent_map. |
102 | - """ |
103 | - parents = self.get_parent_map(revisions) |
104 | - return [parents.get(r, None) for r in revisions] |
105 | - |
106 | def get_parent_map(self, revisions): |
107 | """Get a map of key:parent_list for revisions. |
108 | |
109 | |
110 | === modified file 'bzrlib/hooks.py' |
111 | --- bzrlib/hooks.py 2009-03-18 03:47:30 +0000 |
112 | +++ bzrlib/hooks.py 2009-03-23 21:35:11 +0000 |
113 | @@ -16,9 +16,9 @@ |
114 | |
115 | |
116 | """Support for plugin hooking logic.""" |
117 | +from bzrlib import registry |
118 | from bzrlib.lazy_import import lazy_import |
119 | -from bzrlib import registry |
120 | -from bzrlib.symbol_versioning import deprecated_method, one_five |
121 | +from bzrlib.symbol_versioning import deprecated_method |
122 | lazy_import(globals(), """ |
123 | import textwrap |
124 | |
125 | @@ -132,18 +132,6 @@ |
126 | """ |
127 | return self._callable_names.get(a_callable, "No hook name") |
128 | |
129 | - @deprecated_method(one_five) |
130 | - def install_hook(self, hook_name, a_callable): |
131 | - """Install a_callable in to the hook hook_name. |
132 | - |
133 | - :param hook_name: A hook name. See the __init__ method of BranchHooks |
134 | - for the complete list of hooks. |
135 | - :param a_callable: The callable to be invoked when the hook triggers. |
136 | - The exact signature will depend on the hook - see the __init__ |
137 | - method of BranchHooks for details on each hook. |
138 | - """ |
139 | - self.install_named_hook(hook_name, a_callable, None) |
140 | - |
141 | def install_named_hook(self, hook_name, a_callable, name): |
142 | """Install a_callable in to the hook hook_name, and label it name. |
143 | |
144 | |
145 | === modified file 'bzrlib/index.py' |
146 | --- bzrlib/index.py 2009-03-23 19:35:38 +0000 |
147 | +++ bzrlib/index.py 2009-03-23 21:35:11 +0000 |
148 | @@ -1191,23 +1191,6 @@ |
149 | self.__class__.__name__, |
150 | ', '.join(map(repr, self._indices))) |
151 | |
152 | - @symbol_versioning.deprecated_method(symbol_versioning.one_one) |
153 | - def get_parents(self, revision_ids): |
154 | - """See graph._StackedParentsProvider.get_parents. |
155 | - |
156 | - This implementation thunks the graph.Graph.get_parents api across to |
157 | - GraphIndex. |
158 | - |
159 | - :param revision_ids: An iterable of graph keys for this graph. |
160 | - :return: A list of parent details for each key in revision_ids. |
161 | - Each parent details will be one of: |
162 | - * None when the key was missing |
163 | - * (NULL_REVISION,) when the key has no parents. |
164 | - * (parent_key, parent_key...) otherwise. |
165 | - """ |
166 | - parent_map = self.get_parent_map(revision_ids) |
167 | - return [parent_map.get(r, None) for r in revision_ids] |
168 | - |
169 | def get_parent_map(self, keys): |
170 | """See graph._StackedParentsProvider.get_parent_map""" |
171 | search_keys = set(keys) |
172 | |
173 | === modified file 'bzrlib/plugin.py' |
174 | --- bzrlib/plugin.py 2009-02-26 06:15:24 +0000 |
175 | +++ bzrlib/plugin.py 2009-03-23 21:35:11 +0000 |
176 | @@ -41,7 +41,6 @@ |
177 | import imp |
178 | import re |
179 | import types |
180 | -import zipfile |
181 | |
182 | from bzrlib import ( |
183 | _format_version_tuple, |
184 | @@ -53,7 +52,7 @@ |
185 | from bzrlib import plugins as _mod_plugins |
186 | """) |
187 | |
188 | -from bzrlib.symbol_versioning import deprecated_function, one_three |
189 | +from bzrlib.symbol_versioning import deprecated_function |
190 | |
191 | |
192 | DEFAULT_PLUGIN_PATH = None |
193 | @@ -254,87 +253,6 @@ |
194 | trace.print_exception(sys.exc_info(), sys.stderr) |
195 | |
196 | |
197 | -@deprecated_function(one_three) |
198 | -def load_from_zip(zip_name): |
199 | - """Load all the plugins in a zip.""" |
200 | - valid_suffixes = ('.py', '.pyc', '.pyo') # only python modules/packages |
201 | - # is allowed |
202 | - try: |
203 | - index = zip_name.rindex('.zip') |
204 | - except ValueError: |
205 | - return |
206 | - archive = zip_name[:index+4] |
207 | - prefix = zip_name[index+5:] |
208 | - |
209 | - trace.mutter('Looking for plugins in %r', zip_name) |
210 | - |
211 | - # use zipfile to get list of files/dirs inside zip |
212 | - try: |
213 | - z = zipfile.ZipFile(archive) |
214 | - namelist = z.namelist() |
215 | - z.close() |
216 | - except zipfile.error: |
217 | - # not a valid zip |
218 | - return |
219 | - |
220 | - if prefix: |
221 | - prefix = prefix.replace('\\','/') |
222 | - if prefix[-1] != '/': |
223 | - prefix += '/' |
224 | - ix = len(prefix) |
225 | - namelist = [name[ix:] |
226 | - for name in namelist |
227 | - if name.startswith(prefix)] |
228 | - |
229 | - trace.mutter('Names in archive: %r', namelist) |
230 | - |
231 | - for name in namelist: |
232 | - if not name or name.endswith('/'): |
233 | - continue |
234 | - |
235 | - # '/' is used to separate pathname components inside zip archives |
236 | - ix = name.rfind('/') |
237 | - if ix == -1: |
238 | - head, tail = '', name |
239 | - else: |
240 | - head, tail = name.rsplit('/',1) |
241 | - if '/' in head: |
242 | - # we don't need looking in subdirectories |
243 | - continue |
244 | - |
245 | - base, suffix = osutils.splitext(tail) |
246 | - if suffix not in valid_suffixes: |
247 | - continue |
248 | - |
249 | - if base == '__init__': |
250 | - # package |
251 | - plugin_name = head |
252 | - elif head == '': |
253 | - # module |
254 | - plugin_name = base |
255 | - else: |
256 | - continue |
257 | - |
258 | - if not plugin_name: |
259 | - continue |
260 | - if getattr(_mod_plugins, plugin_name, None): |
261 | - trace.mutter('Plugin name %s already loaded', plugin_name) |
262 | - continue |
263 | - |
264 | - try: |
265 | - exec "import bzrlib.plugins.%s" % plugin_name in {} |
266 | - trace.mutter('Load plugin %s from zip %r', plugin_name, zip_name) |
267 | - except KeyboardInterrupt: |
268 | - raise |
269 | - except Exception, e: |
270 | - ## import pdb; pdb.set_trace() |
271 | - trace.warning('Unable to load plugin %r from %r' |
272 | - % (name, zip_name)) |
273 | - trace.log_exception_quietly() |
274 | - if 'error' in debug.debug_flags: |
275 | - trace.print_exception(sys.exc_info(), sys.stderr) |
276 | - |
277 | - |
278 | def plugins(): |
279 | """Return a dictionary of the plugins. |
280 | |
281 | |
282 | === modified file 'bzrlib/remote.py' |
283 | --- bzrlib/remote.py 2009-03-22 01:30:44 +0000 |
284 | +++ bzrlib/remote.py 2009-03-23 21:35:12 +0000 |
285 | @@ -685,11 +685,6 @@ |
286 | self._ensure_real() |
287 | return self._real_repository._generate_text_key_index() |
288 | |
289 | - @symbol_versioning.deprecated_method(symbol_versioning.one_four) |
290 | - def get_revision_graph(self, revision_id=None): |
291 | - """See Repository.get_revision_graph().""" |
292 | - return self._get_revision_graph(revision_id) |
293 | - |
294 | def _get_revision_graph(self, revision_id): |
295 | """Private method for using with old (< 1.2) servers to fallback.""" |
296 | if revision_id is None: |
297 | @@ -1188,11 +1183,12 @@ |
298 | # We already found out that the server can't understand |
299 | # Repository.get_parent_map requests, so just fetch the whole |
300 | # graph. |
301 | - # XXX: Note that this will issue a deprecation warning. This is ok |
302 | - # :- its because we're working with a deprecated server anyway, and |
303 | - # the user will almost certainly have seen a warning about the |
304 | - # server version already. |
305 | - rg = self.get_revision_graph() |
306 | + # |
307 | + # Note that this reads the whole graph, when only some keys are |
308 | + # wanted. On this old server there's no way (?) to get them all |
309 | + # in one go, and the user probably will have seen a warning about |
310 | + # the server being old anyhow. |
311 | + rg = self._get_revision_graph(None) |
312 | # There is an api discrepency between get_parent_map and |
313 | # get_revision_graph. Specifically, a "key:()" pair in |
314 | # get_revision_graph just means a node has no parents. For |
315 | @@ -1264,7 +1260,8 @@ |
316 | # To avoid having to disconnect repeatedly, we keep track of the |
317 | # fact the server doesn't understand remote methods added in 1.2. |
318 | medium._remember_remote_is_before((1, 2)) |
319 | - return self.get_revision_graph(None) |
320 | + # Recurse just once and we should use the fallback code. |
321 | + return self._get_parent_map_rpc(keys) |
322 | response_tuple, response_handler = response |
323 | if response_tuple[0] not in ['ok']: |
324 | response_handler.cancel_read_body() |
325 | @@ -1291,13 +1288,6 @@ |
326 | return self._real_repository.get_signature_text(revision_id) |
327 | |
328 | @needs_read_lock |
329 | - @symbol_versioning.deprecated_method(symbol_versioning.one_three) |
330 | - def get_revision_graph_with_ghosts(self, revision_ids=None): |
331 | - self._ensure_real() |
332 | - return self._real_repository.get_revision_graph_with_ghosts( |
333 | - revision_ids=revision_ids) |
334 | - |
335 | - @needs_read_lock |
336 | def get_inventory_xml(self, revision_id): |
337 | self._ensure_real() |
338 | return self._real_repository.get_inventory_xml(revision_id) |
339 | |
340 | === modified file 'bzrlib/repofmt/knitrepo.py' |
341 | --- bzrlib/repofmt/knitrepo.py 2009-03-16 05:05:52 +0000 |
342 | +++ bzrlib/repofmt/knitrepo.py 2009-03-23 21:35:12 +0000 |
343 | @@ -53,12 +53,6 @@ |
344 | def __repr__(self): |
345 | return 'KnitParentsProvider(%r)' % self._knit |
346 | |
347 | - @symbol_versioning.deprecated_method(symbol_versioning.one_one) |
348 | - def get_parents(self, revision_ids): |
349 | - """See graph._StackedParentsProvider.get_parents""" |
350 | - parent_map = self.get_parent_map(revision_ids) |
351 | - return [parent_map.get(r, None) for r in revision_ids] |
352 | - |
353 | def get_parent_map(self, keys): |
354 | """See graph._StackedParentsProvider.get_parent_map""" |
355 | parent_map = {} |
356 | |
357 | === modified file 'bzrlib/repofmt/pack_repo.py' |
358 | --- bzrlib/repofmt/pack_repo.py 2009-03-23 19:35:38 +0000 |
359 | +++ bzrlib/repofmt/pack_repo.py 2009-03-23 21:35:12 +0000 |
360 | @@ -2131,12 +2131,6 @@ |
361 | pb.finished() |
362 | return result |
363 | |
364 | - @symbol_versioning.deprecated_method(symbol_versioning.one_one) |
365 | - def get_parents(self, revision_ids): |
366 | - """See graph._StackedParentsProvider.get_parents.""" |
367 | - parent_map = self.get_parent_map(revision_ids) |
368 | - return [parent_map.get(r, None) for r in revision_ids] |
369 | - |
370 | def _make_parents_provider(self): |
371 | return graph.CachingParentsProvider(self) |
372 | |
373 | |
374 | === modified file 'bzrlib/repository.py' |
375 | --- bzrlib/repository.py 2009-03-23 03:46:02 +0000 |
376 | +++ bzrlib/repository.py 2009-03-23 21:35:12 +0000 |
377 | @@ -57,9 +57,6 @@ |
378 | from bzrlib import registry |
379 | from bzrlib.symbol_versioning import ( |
380 | deprecated_method, |
381 | - one_one, |
382 | - one_two, |
383 | - one_six, |
384 | ) |
385 | from bzrlib.trace import ( |
386 | log_exception_quietly, note, mutter, mutter_callsite, warning) |
387 | @@ -1307,24 +1304,6 @@ |
388 | return InterRepository.get(other, self).search_missing_revision_ids( |
389 | revision_id, find_ghosts) |
390 | |
391 | - @deprecated_method(one_two) |
392 | - @needs_read_lock |
393 | - def missing_revision_ids(self, other, revision_id=None, find_ghosts=True): |
394 | - """Return the revision ids that other has that this does not. |
395 | - |
396 | - These are returned in topological order. |
397 | - |
398 | - revision_id: only return revision ids included by revision_id. |
399 | - """ |
400 | - keys = self.search_missing_revision_ids( |
401 | - other, revision_id, find_ghosts).get_keys() |
402 | - other.lock_read() |
403 | - try: |
404 | - parents = other.get_graph().get_parent_map(keys) |
405 | - finally: |
406 | - other.unlock() |
407 | - return tsort.topo_sort(parents) |
408 | - |
409 | @staticmethod |
410 | def open(base): |
411 | """Open the repository rooted at base. |
412 | @@ -2253,34 +2232,9 @@ |
413 | implicitly lock for the user. |
414 | """ |
415 | |
416 | - @needs_read_lock |
417 | - @deprecated_method(one_six) |
418 | - def print_file(self, file, revision_id): |
419 | - """Print `file` to stdout. |
420 | - |
421 | - FIXME RBC 20060125 as John Meinel points out this is a bad api |
422 | - - it writes to stdout, it assumes that that is valid etc. Fix |
423 | - by creating a new more flexible convenience function. |
424 | - """ |
425 | - tree = self.revision_tree(revision_id) |
426 | - # use inventory as it was in that revision |
427 | - file_id = tree.inventory.path2id(file) |
428 | - if not file_id: |
429 | - # TODO: jam 20060427 Write a test for this code path |
430 | - # it had a bug in it, and was raising the wrong |
431 | - # exception. |
432 | - raise errors.BzrError("%r is not present in revision %s" % (file, revision_id)) |
433 | - tree.print_file(file_id) |
434 | - |
435 | def get_transaction(self): |
436 | return self.control_files.get_transaction() |
437 | |
438 | - @deprecated_method(one_one) |
439 | - def get_parents(self, revision_ids): |
440 | - """See StackedParentsProvider.get_parents""" |
441 | - parent_map = self.get_parent_map(revision_ids) |
442 | - return [parent_map.get(r, None) for r in revision_ids] |
443 | - |
444 | def get_parent_map(self, revision_ids): |
445 | """See graph._StackedParentsProvider.get_parent_map""" |
446 | # revisions index works in keys; this just works in revisions |
447 | @@ -3044,21 +2998,6 @@ |
448 | break |
449 | return searcher.get_result() |
450 | |
451 | - @deprecated_method(one_two) |
452 | - @needs_read_lock |
453 | - def missing_revision_ids(self, revision_id=None, find_ghosts=True): |
454 | - """Return the revision ids that source has that target does not. |
455 | - |
456 | - These are returned in topological order. |
457 | - |
458 | - :param revision_id: only return revision ids included by this |
459 | - revision_id. |
460 | - :param find_ghosts: If True find missing revisions in deep history |
461 | - rather than just finding the surface difference. |
462 | - """ |
463 | - return list(self.search_missing_revision_ids( |
464 | - revision_id, find_ghosts).get_keys()) |
465 | - |
466 | @needs_read_lock |
467 | def search_missing_revision_ids(self, revision_id=None, find_ghosts=True): |
468 | """Return the revision ids that source has that target does not. |
469 | |
470 | === modified file 'bzrlib/symbol_versioning.py' |
471 | --- bzrlib/symbol_versioning.py 2009-01-17 01:30:58 +0000 |
472 | +++ bzrlib/symbol_versioning.py 2009-03-23 21:35:12 +0000 |
473 | @@ -1,5 +1,4 @@ |
474 | -# Copyright (C) 2006, 2007, 2008 Canonical Ltd |
475 | -# Authors: Robert Collins <robert.collins@canonical.com> and others |
476 | +# Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd |
477 | # |
478 | # This program is free software; you can redistribute it and/or modify |
479 | # it under the terms of the GNU General Public License as published by |
480 | @@ -28,29 +27,6 @@ |
481 | 'deprecated_passed', |
482 | 'set_warning_method', |
483 | 'warn', |
484 | - 'zero_seven', |
485 | - 'zero_eight', |
486 | - 'zero_nine', |
487 | - 'zero_ten', |
488 | - 'zero_eleven', |
489 | - 'zero_twelve', |
490 | - 'zero_thirteen', |
491 | - 'zero_fourteen', |
492 | - 'zero_fifteen', |
493 | - 'zero_sixteen', |
494 | - 'zero_seventeen', |
495 | - 'zero_eighteen', |
496 | - 'zero_ninety', |
497 | - 'zero_ninetyone', |
498 | - 'zero_ninetytwo', |
499 | - 'zero_ninetythree', |
500 | - 'one_zero', |
501 | - 'one_one', |
502 | - 'one_two', |
503 | - 'one_three', |
504 | - 'one_four', |
505 | - 'one_five', |
506 | - 'one_six', |
507 | ] |
508 | |
509 | from warnings import warn |
510 | @@ -59,29 +35,6 @@ |
511 | |
512 | |
513 | DEPRECATED_PARAMETER = "A deprecated parameter marker." |
514 | -zero_seven = "%s was deprecated in version 0.7." |
515 | -zero_eight = "%s was deprecated in version 0.8." |
516 | -zero_nine = "%s was deprecated in version 0.9." |
517 | -zero_ten = "%s was deprecated in version 0.10." |
518 | -zero_eleven = "%s was deprecated in version 0.11." |
519 | -zero_twelve = "%s was deprecated in version 0.12." |
520 | -zero_thirteen = "%s was deprecated in version 0.13." |
521 | -zero_fourteen = "%s was deprecated in version 0.14." |
522 | -zero_fifteen = "%s was deprecated in version 0.15." |
523 | -zero_sixteen = "%s was deprecated in version 0.16." |
524 | -zero_seventeen = "%s was deprecated in version 0.17." |
525 | -zero_eighteen = "%s was deprecated in version 0.18." |
526 | -zero_ninety = "%s was deprecated in version 0.90." |
527 | -zero_ninetyone = "%s was deprecated in version 0.91." |
528 | -zero_ninetytwo = "%s was deprecated in version 0.92." |
529 | -one_zero = "%s was deprecated in version 1.0." |
530 | -zero_ninetythree = one_zero # Maintained for backwards compatibility |
531 | -one_one = "%s was deprecated in version 1.1." |
532 | -one_two = "%s was deprecated in version 1.2." |
533 | -one_three = "%s was deprecated in version 1.3." |
534 | -one_four = "%s was deprecated in version 1.4." |
535 | -one_five = "%s was deprecated in version 1.5." |
536 | -one_six = "%s was deprecated in version 1.6." |
537 | |
538 | |
539 | def deprecated_in(version_tuple): |
540 | |
541 | === modified file 'bzrlib/tests/interrepository_implementations/test_interrepository.py' |
542 | --- bzrlib/tests/interrepository_implementations/test_interrepository.py 2009-03-17 06:18:16 +0000 |
543 | +++ bzrlib/tests/interrepository_implementations/test_interrepository.py 2009-03-23 21:35:12 +0000 |
544 | @@ -27,7 +27,6 @@ |
545 | import bzrlib.repofmt.weaverepo as weaverepo |
546 | import bzrlib.repository as repository |
547 | from bzrlib.revision import NULL_REVISION, Revision |
548 | -from bzrlib.symbol_versioning import one_two |
549 | from bzrlib.tests import ( |
550 | TestCase, |
551 | TestCaseWithTransport, |
552 | @@ -115,19 +114,6 @@ |
553 | tree_a.branch.repository.commit_write_group() |
554 | tree_a.branch.repository.unlock() |
555 | |
556 | - def test_missing_revision_ids_is_deprecated(self): |
557 | - repo_b = self.make_to_repository('rev1_only') |
558 | - repo_a = self.bzrdir.open_repository() |
559 | - repo_b.fetch(repo_a, 'rev1') |
560 | - # check the test will be valid |
561 | - self.assertFalse(repo_b.has_revision('rev2')) |
562 | - self.assertEqual(['rev2'], |
563 | - self.applyDeprecated(one_two, repo_b.missing_revision_ids, repo_a)) |
564 | - inter = repository.InterRepository.get(repo_a, repo_b) |
565 | - self.assertEqual(['rev2'], |
566 | - self.applyDeprecated(one_two, inter.missing_revision_ids, None, |
567 | - True)) |
568 | - |
569 | def test_search_missing_revision_ids(self): |
570 | # revision ids in repository A but not B are returned, fake ones |
571 | # are stripped. (fake meaning no revision object, but an inventory |
572 | |
573 | === modified file 'bzrlib/tests/per_repository/test_repository.py' |
574 | --- bzrlib/tests/per_repository/test_repository.py 2009-03-22 01:30:44 +0000 |
575 | +++ bzrlib/tests/per_repository/test_repository.py 2009-03-23 21:35:12 +0000 |
576 | @@ -39,7 +39,6 @@ |
577 | ) |
578 | from bzrlib.revision import NULL_REVISION, Revision |
579 | from bzrlib.smart import server |
580 | -from bzrlib.symbol_versioning import one_two, one_three, one_four |
581 | from bzrlib.tests import ( |
582 | KnownFailure, |
583 | TestCaseWithTransport, |
584 | |
585 | === modified file 'bzrlib/tests/test_hooks.py' |
586 | --- bzrlib/tests/test_hooks.py 2009-03-12 06:24:39 +0000 |
587 | +++ bzrlib/tests/test_hooks.py 2009-03-23 21:35:12 +0000 |
588 | @@ -1,4 +1,4 @@ |
589 | -# Copyright (C) 2007 Canonical Ltd |
590 | +# Copyright (C) 2007, 2009 Canonical Ltd |
591 | # |
592 | # This program is free software; you can redistribute it and/or modify |
593 | # it under the terms of the GNU General Public License as published by |
594 | @@ -28,7 +28,6 @@ |
595 | UnknownHook, |
596 | ) |
597 | |
598 | -from bzrlib.symbol_versioning import one_five |
599 | from bzrlib.tests import TestCase |
600 | |
601 | |
602 | @@ -96,19 +95,6 @@ |
603 | "ChangeBranchTipParams object. Hooks should raise TipChangeRejected to\n" |
604 | "signal that a tip change is not permitted.\n", hooks.docs()) |
605 | |
606 | - def test_install_hook_raises_unknown_hook(self): |
607 | - """install_hook should raise UnknownHook if a hook is unknown.""" |
608 | - hooks = Hooks() |
609 | - self.assertRaises(UnknownHook, self.applyDeprecated, one_five, |
610 | - hooks.install_hook, 'silly', None) |
611 | - |
612 | - def test_install_hook_appends_known_hook(self): |
613 | - """install_hook should append the callable for known hooks.""" |
614 | - hooks = Hooks() |
615 | - hooks['set_rh'] = [] |
616 | - self.applyDeprecated(one_five, hooks.install_hook, 'set_rh', None) |
617 | - self.assertEqual(hooks['set_rh'], [None]) |
618 | - |
619 | def test_install_named_hook_raises_unknown_hook(self): |
620 | hooks = Hooks() |
621 | self.assertRaises(UnknownHook, hooks.install_named_hook, 'silly', |
622 | @@ -126,20 +112,6 @@ |
623 | hooks.install_named_hook('set_rh', None, "demo") |
624 | self.assertEqual("demo", hooks.get_hook_name(None)) |
625 | |
626 | - def test_name_hook_and_retrieve_name(self): |
627 | - """name_hook puts the name in the names mapping.""" |
628 | - hooks = Hooks() |
629 | - hooks['set_rh'] = [] |
630 | - self.applyDeprecated(one_five, hooks.install_hook, 'set_rh', None) |
631 | - hooks.name_hook(None, 'demo') |
632 | - self.assertEqual("demo", hooks.get_hook_name(None)) |
633 | - |
634 | - def test_get_unnamed_hook_name_is_unnamed(self): |
635 | - hooks = Hooks() |
636 | - hooks['set_rh'] = [] |
637 | - self.applyDeprecated(one_five, hooks.install_hook, 'set_rh', None) |
638 | - self.assertEqual("No hook name", hooks.get_hook_name(None)) |
639 | - |
640 | |
641 | class TestHook(TestCase): |
642 | |
643 | |
644 | === modified file 'bzrlib/tests/test_merge.py' |
645 | --- bzrlib/tests/test_merge.py 2009-03-08 01:32:37 +0000 |
646 | +++ bzrlib/tests/test_merge.py 2009-03-23 21:35:12 +0000 |
647 | @@ -35,7 +35,6 @@ |
648 | from bzrlib.merge import transform_tree, merge_inner, _PlanMerge |
649 | from bzrlib.osutils import pathjoin, file_kind |
650 | from bzrlib.tests import TestCaseWithTransport, TestCaseWithMemoryTransport |
651 | -from bzrlib.trace import (enable_test_log, disable_test_log) |
652 | from bzrlib.workingtree import WorkingTree |
653 | |
654 | |
655 | |
656 | === modified file 'bzrlib/tests/test_plugins.py' |
657 | --- bzrlib/tests/test_plugins.py 2009-01-17 01:30:58 +0000 |
658 | +++ bzrlib/tests/test_plugins.py 2009-03-23 21:35:12 +0000 |
659 | @@ -31,7 +31,6 @@ |
660 | import bzrlib.plugins |
661 | import bzrlib.commands |
662 | import bzrlib.help |
663 | -from bzrlib.symbol_versioning import one_three |
664 | from bzrlib.tests import ( |
665 | TestCase, |
666 | TestCaseInTempDir, |
667 | @@ -455,40 +454,6 @@ |
668 | delattr(bzrlib.plugins, 'myplug') |
669 | |
670 | |
671 | -class TestPluginFromZip(TestCaseInTempDir): |
672 | - |
673 | - def make_zipped_plugin(self, zip_name, filename): |
674 | - z = zipfile.ZipFile(zip_name, 'w') |
675 | - z.writestr(filename, PLUGIN_TEXT) |
676 | - z.close() |
677 | - |
678 | - def check_plugin_load(self, zip_name, plugin_name): |
679 | - self.assertFalse(plugin_name in dir(bzrlib.plugins), |
680 | - 'Plugin already loaded') |
681 | - old_path = bzrlib.plugins.__path__ |
682 | - try: |
683 | - # this is normally done by load_plugins -> set_plugins_path |
684 | - bzrlib.plugins.__path__ = [zip_name] |
685 | - self.applyDeprecated(one_three, |
686 | - bzrlib.plugin.load_from_zip, zip_name) |
687 | - self.assertTrue(plugin_name in dir(bzrlib.plugins), |
688 | - 'Plugin is not loaded') |
689 | - finally: |
690 | - # unregister plugin |
691 | - if getattr(bzrlib.plugins, plugin_name, None): |
692 | - delattr(bzrlib.plugins, plugin_name) |
693 | - del sys.modules['bzrlib.plugins.' + plugin_name] |
694 | - bzrlib.plugins.__path__ = old_path |
695 | - |
696 | - def test_load_module(self): |
697 | - self.make_zipped_plugin('./test.zip', 'ziplug.py') |
698 | - self.check_plugin_load('./test.zip', 'ziplug') |
699 | - |
700 | - def test_load_package(self): |
701 | - self.make_zipped_plugin('./test.zip', 'ziplug/__init__.py') |
702 | - self.check_plugin_load('./test.zip', 'ziplug') |
703 | - |
704 | - |
705 | class TestSetPluginsPath(TestCase): |
706 | |
707 | def test_set_plugins_path(self): |
708 | |
709 | === modified file 'bzrlib/tests/test_remote.py' |
710 | --- bzrlib/tests/test_remote.py 2009-03-18 01:27:58 +0000 |
711 | +++ bzrlib/tests/test_remote.py 2009-03-23 21:35:12 +0000 |
712 | @@ -1,4 +1,4 @@ |
713 | -# Copyright (C) 2006, 2007, 2008 Canonical Ltd |
714 | +# Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd |
715 | # |
716 | # This program is free software; you can redistribute it and/or modify |
717 | # it under the terms of the GNU General Public License as published by |
718 | @@ -50,7 +50,6 @@ |
719 | from bzrlib.revision import NULL_REVISION |
720 | from bzrlib.smart import server, medium |
721 | from bzrlib.smart.client import _SmartClient |
722 | -from bzrlib.symbol_versioning import one_four |
723 | from bzrlib.tests import ( |
724 | condition_isinstance, |
725 | split_suite_by_condition, |
726 | @@ -1562,16 +1561,12 @@ |
727 | |
728 | def test_get_parent_map_reconnects_if_unknown_method(self): |
729 | transport_path = 'quack' |
730 | + rev_id = 'revision-id' |
731 | repo, client = self.setup_fake_client_and_repository(transport_path) |
732 | - client.add_unknown_method_response('Repository,get_parent_map') |
733 | - client.add_success_response_with_body('', 'ok') |
734 | + client.add_unknown_method_response('Repository.get_parent_map') |
735 | + client.add_success_response_with_body(rev_id, 'ok') |
736 | self.assertFalse(client._medium._is_remote_before((1, 2))) |
737 | - rev_id = 'revision-id' |
738 | - expected_deprecations = [ |
739 | - 'bzrlib.remote.RemoteRepository.get_revision_graph was deprecated ' |
740 | - 'in version 1.4.'] |
741 | - parents = self.callDeprecated( |
742 | - expected_deprecations, repo.get_parent_map, [rev_id]) |
743 | + parents = repo.get_parent_map([rev_id]) |
744 | self.assertEqual( |
745 | [('call_with_body_bytes_expecting_body', |
746 | 'Repository.get_parent_map', ('quack/', rev_id), '\n\n0'), |
747 | @@ -1581,6 +1576,7 @@ |
748 | client._calls) |
749 | # The medium is now marked as being connected to an older server |
750 | self.assertTrue(client._medium._is_remote_before((1, 2))) |
751 | + self.assertEqual({rev_id: ('null:',)}, parents) |
752 | |
753 | def test_get_parent_map_fallback_parentless_node(self): |
754 | """get_parent_map falls back to get_revision_graph on old servers. The |
755 | @@ -1598,11 +1594,7 @@ |
756 | repo, client = self.setup_fake_client_and_repository(transport_path) |
757 | client.add_success_response_with_body(rev_id, 'ok') |
758 | client._medium._remember_remote_is_before((1, 2)) |
759 | - expected_deprecations = [ |
760 | - 'bzrlib.remote.RemoteRepository.get_revision_graph was deprecated ' |
761 | - 'in version 1.4.'] |
762 | - parents = self.callDeprecated( |
763 | - expected_deprecations, repo.get_parent_map, [rev_id]) |
764 | + parents = repo.get_parent_map([rev_id]) |
765 | self.assertEqual( |
766 | [('call_expecting_body', 'Repository.get_revision_graph', |
767 | ('quack/', ''))], |
768 | @@ -1645,8 +1637,9 @@ |
769 | transport_path = 'empty' |
770 | repo, client = self.setup_fake_client_and_repository(transport_path) |
771 | client.add_success_response('notused') |
772 | - result = self.applyDeprecated(one_four, repo.get_revision_graph, |
773 | - NULL_REVISION) |
774 | + # actual RemoteRepository.get_revision_graph is gone, but there's an |
775 | + # equivalent private method for testing |
776 | + result = repo._get_revision_graph(NULL_REVISION) |
777 | self.assertEqual([], client._calls) |
778 | self.assertEqual({}, result) |
779 | |
780 | @@ -1660,7 +1653,9 @@ |
781 | transport_path = 'sinhala' |
782 | repo, client = self.setup_fake_client_and_repository(transport_path) |
783 | client.add_success_response_with_body(encoded_body, 'ok') |
784 | - result = self.applyDeprecated(one_four, repo.get_revision_graph) |
785 | + # actual RemoteRepository.get_revision_graph is gone, but there's an |
786 | + # equivalent private method for testing |
787 | + result = repo._get_revision_graph(None) |
788 | self.assertEqual( |
789 | [('call_expecting_body', 'Repository.get_revision_graph', |
790 | ('sinhala/', ''))], |
791 | @@ -1679,7 +1674,7 @@ |
792 | transport_path = 'sinhala' |
793 | repo, client = self.setup_fake_client_and_repository(transport_path) |
794 | client.add_success_response_with_body(encoded_body, 'ok') |
795 | - result = self.applyDeprecated(one_four, repo.get_revision_graph, r2) |
796 | + result = repo._get_revision_graph(r2) |
797 | self.assertEqual( |
798 | [('call_expecting_body', 'Repository.get_revision_graph', |
799 | ('sinhala/', r2))], |
800 | @@ -1693,7 +1688,7 @@ |
801 | client.add_error_response('nosuchrevision', revid) |
802 | # also check that the right revision is reported in the error |
803 | self.assertRaises(errors.NoSuchRevision, |
804 | - self.applyDeprecated, one_four, repo.get_revision_graph, revid) |
805 | + repo._get_revision_graph, revid) |
806 | self.assertEqual( |
807 | [('call_expecting_body', 'Repository.get_revision_graph', |
808 | ('sinhala/', revid))], |
809 | @@ -1705,7 +1700,7 @@ |
810 | repo, client = self.setup_fake_client_and_repository(transport_path) |
811 | client.add_error_response('AnUnexpectedError') |
812 | e = self.assertRaises(errors.UnknownErrorFromSmartServer, |
813 | - self.applyDeprecated, one_four, repo.get_revision_graph, revid) |
814 | + repo._get_revision_graph, revid) |
815 | self.assertEqual(('AnUnexpectedError',), e.error_tuple) |
816 | |
817 | |
818 | |
819 | === modified file 'bzrlib/tests/test_revision.py' |
820 | --- bzrlib/tests/test_revision.py 2009-03-12 07:35:17 +0000 |
821 | +++ bzrlib/tests/test_revision.py 2009-03-23 21:35:12 +0000 |
822 | @@ -32,7 +32,6 @@ |
823 | from bzrlib.deprecated_graph import Graph |
824 | from bzrlib.revision import (find_present_ancestors, |
825 | NULL_REVISION) |
826 | -from bzrlib.symbol_versioning import one_three |
827 | from bzrlib.tests import TestCase, TestCaseWithTransport |
828 | from bzrlib.trace import mutter |
829 | from bzrlib.workingtree import WorkingTree |
830 | |
831 | === modified file 'bzrlib/tests/test_selftest.py' |
832 | --- bzrlib/tests/test_selftest.py 2009-03-17 05:30:24 +0000 |
833 | +++ bzrlib/tests/test_selftest.py 2009-03-23 21:35:12 +0000 |
834 | @@ -1,4 +1,4 @@ |
835 | -# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd |
836 | +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd |
837 | # |
838 | # This program is free software; you can redistribute it and/or modify |
839 | # it under the terms of the GNU General Public License as published by |
840 | @@ -43,9 +43,9 @@ |
841 | weaverepo, |
842 | ) |
843 | from bzrlib.symbol_versioning import ( |
844 | - one_zero, |
845 | - zero_eleven, |
846 | - zero_ten, |
847 | + deprecated_function, |
848 | + deprecated_in, |
849 | + deprecated_method, |
850 | ) |
851 | from bzrlib.tests import ( |
852 | ChrootedTestCase, |
853 | @@ -1654,7 +1654,8 @@ |
854 | self.assertListRaises, _TestException, success_generator) |
855 | |
856 | |
857 | -@symbol_versioning.deprecated_function(zero_eleven) |
858 | +# NB: Don't delete this; it's not actually from 0.11! |
859 | +@deprecated_function(deprecated_in((0, 11, 0))) |
860 | def sample_deprecated_function(): |
861 | """A deprecated function to test applyDeprecated with.""" |
862 | return 2 |
863 | @@ -1667,7 +1668,7 @@ |
864 | class ApplyDeprecatedHelper(object): |
865 | """A helper class for ApplyDeprecated tests.""" |
866 | |
867 | - @symbol_versioning.deprecated_method(zero_eleven) |
868 | + @deprecated_method(deprecated_in((0, 11, 0))) |
869 | def sample_deprecated_method(self, param_one): |
870 | """A deprecated method for testing with.""" |
871 | return param_one |
872 | @@ -1675,7 +1676,7 @@ |
873 | def sample_normal_method(self): |
874 | """A undeprecated method.""" |
875 | |
876 | - @symbol_versioning.deprecated_method(zero_ten) |
877 | + @deprecated_method(deprecated_in((0, 10, 0))) |
878 | def sample_nested_deprecation(self): |
879 | return sample_deprecated_function() |
880 | |
881 | @@ -1696,30 +1697,35 @@ |
882 | def test_applyDeprecated_not_deprecated(self): |
883 | sample_object = ApplyDeprecatedHelper() |
884 | # calling an undeprecated callable raises an assertion |
885 | - self.assertRaises(AssertionError, self.applyDeprecated, zero_eleven, |
886 | + self.assertRaises(AssertionError, self.applyDeprecated, |
887 | + deprecated_in((0, 11, 0)), |
888 | sample_object.sample_normal_method) |
889 | - self.assertRaises(AssertionError, self.applyDeprecated, zero_eleven, |
890 | + self.assertRaises(AssertionError, self.applyDeprecated, |
891 | + deprecated_in((0, 11, 0)), |
892 | sample_undeprecated_function, "a param value") |
893 | # calling a deprecated callable (function or method) with the wrong |
894 | # expected deprecation fails. |
895 | - self.assertRaises(AssertionError, self.applyDeprecated, zero_ten, |
896 | + self.assertRaises(AssertionError, self.applyDeprecated, |
897 | + deprecated_in((0, 10, 0)), |
898 | sample_object.sample_deprecated_method, "a param value") |
899 | - self.assertRaises(AssertionError, self.applyDeprecated, zero_ten, |
900 | + self.assertRaises(AssertionError, self.applyDeprecated, |
901 | + deprecated_in((0, 10, 0)), |
902 | sample_deprecated_function) |
903 | # calling a deprecated callable (function or method) with the right |
904 | # expected deprecation returns the functions result. |
905 | - self.assertEqual("a param value", self.applyDeprecated(zero_eleven, |
906 | + self.assertEqual("a param value", |
907 | + self.applyDeprecated(deprecated_in((0, 11, 0)), |
908 | sample_object.sample_deprecated_method, "a param value")) |
909 | - self.assertEqual(2, self.applyDeprecated(zero_eleven, |
910 | + self.assertEqual(2, self.applyDeprecated(deprecated_in((0, 11, 0)), |
911 | sample_deprecated_function)) |
912 | # calling a nested deprecation with the wrong deprecation version |
913 | # fails even if a deeper nested function was deprecated with the |
914 | # supplied version. |
915 | self.assertRaises(AssertionError, self.applyDeprecated, |
916 | - zero_eleven, sample_object.sample_nested_deprecation) |
917 | + deprecated_in((0, 11, 0)), sample_object.sample_nested_deprecation) |
918 | # calling a nested deprecation with the right deprecation value |
919 | # returns the calls result. |
920 | - self.assertEqual(2, self.applyDeprecated(zero_ten, |
921 | + self.assertEqual(2, self.applyDeprecated(deprecated_in((0, 10, 0)), |
922 | sample_object.sample_nested_deprecation)) |
923 | |
924 | def test_callDeprecated(self): |
925 | |
926 | === modified file 'bzrlib/tests/test_symbol_versioning.py' |
927 | --- bzrlib/tests/test_symbol_versioning.py 2009-03-17 03:02:33 +0000 |
928 | +++ bzrlib/tests/test_symbol_versioning.py 2009-03-23 21:35:12 +0000 |
929 | @@ -1,6 +1,4 @@ |
930 | -# Copyright (C) 2006, 2007 Canonical Ltd |
931 | -# Authors: Robert Collins <robert.collins@canonical.com> |
932 | -# and others |
933 | +# Copyright (C) 2006, 2007, 2009 Canonical Ltd |
934 | # |
935 | # This program is free software; you can redistribute it and/or modify |
936 | # it under the terms of the GNU General Public License as published by |
937 | @@ -21,21 +19,27 @@ |
938 | import warnings |
939 | |
940 | from bzrlib import symbol_versioning |
941 | +from bzrlib.symbol_versioning import ( |
942 | + deprecated_function, |
943 | + deprecated_in, |
944 | + deprecated_list, |
945 | + deprecated_method, |
946 | + ) |
947 | from bzrlib.tests import TestCase |
948 | |
949 | |
950 | -@symbol_versioning.deprecated_function(symbol_versioning.zero_seven) |
951 | -def deprecated_function(): |
952 | +@deprecated_function(deprecated_in((0, 7, 0))) |
953 | +def sample_deprecated_function(): |
954 | """Deprecated function docstring.""" |
955 | return 1 |
956 | |
957 | |
958 | -a_deprecated_list = symbol_versioning.deprecated_list(symbol_versioning.zero_nine, |
959 | +a_deprecated_list = symbol_versioning.deprecated_list(deprecated_in((0, 9, 0)), |
960 | 'a_deprecated_list', ['one'], extra="Don't use me") |
961 | |
962 | |
963 | a_deprecated_dict = symbol_versioning.DeprecatedDict( |
964 | - symbol_versioning.zero_fourteen, |
965 | + deprecated_in((0, 14, 0)), |
966 | 'a_deprecated_dict', |
967 | dict(a=42), |
968 | advice='Pull the other one!', |
969 | @@ -50,8 +54,8 @@ |
970 | def setUp(self): |
971 | super(TestDeprecationWarnings, self).setUp() |
972 | self._warnings = [] |
973 | - |
974 | - @symbol_versioning.deprecated_method(symbol_versioning.zero_seven) |
975 | + |
976 | + @deprecated_method(deprecated_in((0, 7, 0))) |
977 | def deprecated_method(self): |
978 | """Deprecated method docstring. |
979 | |
980 | @@ -60,7 +64,7 @@ |
981 | return 1 |
982 | |
983 | @staticmethod |
984 | - @symbol_versioning.deprecated_function(symbol_versioning.zero_seven) |
985 | + @deprecated_function(deprecated_in((0, 7, 0))) |
986 | def deprecated_static(): |
987 | """Deprecated static.""" |
988 | return 1 |
989 | @@ -102,16 +106,16 @@ |
990 | |
991 | def test_deprecated_function(self): |
992 | expected_warning = ( |
993 | - "bzrlib.tests.test_symbol_versioning.deprecated_function " |
994 | + "bzrlib.tests.test_symbol_versioning.sample_deprecated_function " |
995 | "was deprecated in version 0.7.", DeprecationWarning, 2) |
996 | expected_docstring = ('Deprecated function docstring.\n' |
997 | '\n' |
998 | 'This function was deprecated in version 0.7.\n' |
999 | ) |
1000 | self.check_deprecated_callable(expected_warning, expected_docstring, |
1001 | - "deprecated_function", |
1002 | + "sample_deprecated_function", |
1003 | "bzrlib.tests.test_symbol_versioning", |
1004 | - deprecated_function) |
1005 | + sample_deprecated_function) |
1006 | |
1007 | def test_deprecated_list(self): |
1008 | expected_warning = ( |
1009 | @@ -203,12 +207,13 @@ |
1010 | 'TestDeprecationWarnings.test_deprecation_string was deprecated in ' |
1011 | 'version 0.11.', |
1012 | symbol_versioning.deprecation_string( |
1013 | - self.test_deprecation_string, symbol_versioning.zero_eleven)) |
1014 | + self.test_deprecation_string, |
1015 | + deprecated_in((0, 11, 0)))) |
1016 | self.assertEqual('bzrlib.symbol_versioning.deprecated_function was ' |
1017 | 'deprecated in version 0.11.', |
1018 | symbol_versioning.deprecation_string( |
1019 | symbol_versioning.deprecated_function, |
1020 | - symbol_versioning.zero_eleven)) |
1021 | + deprecated_in((0, 11, 0)))) |
1022 | |
1023 | |
1024 | class TestSuppressAndActivate(TestCase): |
1025 | |
1026 | === modified file 'bzrlib/tests/test_versionedfile.py' |
1027 | --- bzrlib/tests/test_versionedfile.py 2009-03-12 03:39:10 +0000 |
1028 | +++ bzrlib/tests/test_versionedfile.py 2009-03-23 21:35:12 +0000 |
1029 | @@ -43,7 +43,6 @@ |
1030 | KnitAnnotateFactory, |
1031 | KnitPlainFactory, |
1032 | ) |
1033 | -from bzrlib.symbol_versioning import one_four, one_five |
1034 | from bzrlib.tests import ( |
1035 | TestCase, |
1036 | TestCaseWithMemoryTransport, |
1037 | |
1038 | === modified file 'bzrlib/trace.py' |
1039 | --- bzrlib/trace.py 2009-02-23 15:29:35 +0000 |
1040 | +++ bzrlib/trace.py 2009-03-23 21:35:12 +0000 |
1041 | @@ -329,21 +329,6 @@ |
1042 | new_trace_file.flush() |
1043 | |
1044 | |
1045 | -@symbol_versioning.deprecated_function(symbol_versioning.one_two) |
1046 | -def enable_test_log(to_file): |
1047 | - """Redirect logging to a temporary file for a test |
1048 | - |
1049 | - :returns: an opaque reference that should be passed to disable_test_log |
1050 | - after the test completes. |
1051 | - """ |
1052 | - return push_log_file(to_file) |
1053 | - |
1054 | - |
1055 | -@symbol_versioning.deprecated_function(symbol_versioning.one_two) |
1056 | -def disable_test_log(memento): |
1057 | - return pop_log_file(memento) |
1058 | - |
1059 | - |
1060 | def log_exception_quietly(): |
1061 | """Log the last exception to the trace file only. |
1062 | |
1063 | @@ -398,15 +383,6 @@ |
1064 | return _verbosity_level > 0 |
1065 | |
1066 | |
1067 | -@symbol_versioning.deprecated_function(symbol_versioning.one_two) |
1068 | -def disable_default_logging(): |
1069 | - """Turn off default log handlers. |
1070 | - |
1071 | - Don't call this method, use _push_log_file and _pop_log_file instead. |
1072 | - """ |
1073 | - pass |
1074 | - |
1075 | - |
1076 | def debug_memory(message='', short=True): |
1077 | """Write out a memory dump.""" |
1078 | if sys.platform == 'win32': |
1079 | |
1080 | === modified file 'bzrlib/transport/__init__.py' |
1081 | --- bzrlib/transport/__init__.py 2009-03-01 10:02:00 +0000 |
1082 | +++ bzrlib/transport/__init__.py 2009-03-23 21:35:12 +0000 |
1083 | @@ -50,7 +50,6 @@ |
1084 | deprecated_method, |
1085 | deprecated_function, |
1086 | DEPRECATED_PARAMETER, |
1087 | - one_four, |
1088 | ) |
1089 | from bzrlib.trace import ( |
1090 | mutter, |
1091 | @@ -587,17 +586,6 @@ |
1092 | finally: |
1093 | f.close() |
1094 | |
1095 | - @deprecated_method(one_four) |
1096 | - def get_smart_client(self): |
1097 | - """Return a smart client for this transport if possible. |
1098 | - |
1099 | - A smart client doesn't imply the presence of a smart server: it implies |
1100 | - that the smart protocol can be tunnelled via this transport. |
1101 | - |
1102 | - :raises NoSmartServer: if no smart server client is available. |
1103 | - """ |
1104 | - raise errors.NoSmartServer(self.base) |
1105 | - |
1106 | def get_smart_medium(self): |
1107 | """Return a smart client medium for this transport if possible. |
1108 | |
1109 | @@ -608,17 +596,6 @@ |
1110 | """ |
1111 | raise errors.NoSmartMedium(self) |
1112 | |
1113 | - @deprecated_method(one_four) |
1114 | - def get_shared_medium(self): |
1115 | - """Return a smart client shared medium for this transport if possible. |
1116 | - |
1117 | - A smart medium doesn't imply the presence of a smart server: it implies |
1118 | - that the smart protocol can be tunnelled via this transport. |
1119 | - |
1120 | - :raises NoSmartMedium: if no smart server medium is available. |
1121 | - """ |
1122 | - raise errors.NoSmartMedium(self) |
1123 | - |
1124 | def readv(self, relpath, offsets, adjust_for_latency=False, |
1125 | upper_limit=None): |
1126 | """Get parts of the file at the given relative path. |
1127 | |
1128 | === modified file 'bzrlib/transport/readonly.py' |
1129 | --- bzrlib/transport/readonly.py 2009-01-17 01:30:58 +0000 |
1130 | +++ bzrlib/transport/readonly.py 2009-03-23 21:35:12 +0000 |
1131 | @@ -1,4 +1,4 @@ |
1132 | -# Copyright (C) 2006 Canonical Ltd |
1133 | +# Copyright (C) 2006, 2009 Canonical Ltd |
1134 | # |
1135 | # This program is free software; you can redistribute it and/or modify |
1136 | # it under the terms of the GNU General Public License as published by |
1137 | @@ -16,7 +16,7 @@ |
1138 | |
1139 | """Implementation of Transport that adapts another transport to be readonly.""" |
1140 | |
1141 | -from bzrlib.errors import TransportNotPossible, NoSmartServer, NoSmartMedium |
1142 | +from bzrlib.errors import TransportNotPossible, NoSmartMedium |
1143 | from bzrlib.transport.decorator import TransportDecorator, DecoratorServer |
1144 | |
1145 | |
1146 | |
1147 | === modified file 'bzrlib/transport/remote.py' |
1148 | --- bzrlib/transport/remote.py 2009-03-10 04:57:28 +0000 |
1149 | +++ bzrlib/transport/remote.py 2009-03-23 21:35:12 +0000 |
1150 | @@ -34,7 +34,9 @@ |
1151 | urlutils, |
1152 | ) |
1153 | from bzrlib.smart import client, medium |
1154 | -from bzrlib.symbol_versioning import (deprecated_method, one_four) |
1155 | +from bzrlib.symbol_versioning import ( |
1156 | + deprecated_method, |
1157 | + ) |
1158 | |
1159 | |
1160 | class _SmartStat(object): |
1161 | @@ -166,10 +168,6 @@ |
1162 | def get_smart_medium(self): |
1163 | return self._get_connection() |
1164 | |
1165 | - @deprecated_method(one_four) |
1166 | - def get_shared_medium(self): |
1167 | - return self._get_shared_connection() |
1168 | - |
1169 | def _remote_path(self, relpath): |
1170 | """Returns the Unicode version of the absolute path for relpath.""" |
1171 | return self._combine_paths(self._path, relpath) |
1172 | |
1173 | === modified file 'bzrlib/tree.py' |
1174 | --- bzrlib/tree.py 2009-03-11 04:40:19 +0000 |
1175 | +++ bzrlib/tree.py 2009-03-23 21:35:12 +0000 |
1176 | @@ -97,10 +97,6 @@ |
1177 | want_unversioned=want_unversioned, |
1178 | ) |
1179 | |
1180 | - @symbol_versioning.deprecated_method(symbol_versioning.one_three) |
1181 | - def _iter_changes(self, *args, **kwargs): |
1182 | - return self.iter_changes(*args, **kwargs) |
1183 | - |
1184 | def iter_changes(self, from_tree, include_unchanged=False, |
1185 | specific_files=None, pb=None, extra_trees=None, |
1186 | require_versioned=True, want_unversioned=False): |
1187 | @@ -548,12 +544,6 @@ |
1188 | for child in getattr(entry, 'children', {}).itervalues(): |
1189 | yield child.file_id |
1190 | |
1191 | - @symbol_versioning.deprecated_method(symbol_versioning.one_six) |
1192 | - def print_file(self, file_id): |
1193 | - """Print file with id `file_id` to stdout.""" |
1194 | - import sys |
1195 | - sys.stdout.write(self.get_file_text(file_id)) |
1196 | - |
1197 | def lock_read(self): |
1198 | pass |
1199 | |
1200 | |
1201 | === modified file 'bzrlib/version_info_formats/__init__.py' |
1202 | --- bzrlib/version_info_formats/__init__.py 2009-01-17 01:30:58 +0000 |
1203 | +++ bzrlib/version_info_formats/__init__.py 2009-03-23 21:35:12 +0000 |
1204 | @@ -22,7 +22,6 @@ |
1205 | from bzrlib import registry |
1206 | from bzrlib.symbol_versioning import ( |
1207 | deprecated_function, |
1208 | - one_zero, |
1209 | ) |
1210 | |
1211 | |
1212 | |
1213 | === modified file 'bzrlib/weave.py' |
1214 | --- bzrlib/weave.py 2009-03-18 01:27:58 +0000 |
1215 | +++ bzrlib/weave.py 2009-03-23 21:35:12 +0000 |
1216 | @@ -972,13 +972,6 @@ |
1217 | super(WeaveFile, self).insert_record_stream(stream) |
1218 | self._save() |
1219 | |
1220 | - @deprecated_method(one_five) |
1221 | - def join(self, other, pb=None, msg=None, version_ids=None, |
1222 | - ignore_missing=False): |
1223 | - """Join other into self and save.""" |
1224 | - super(WeaveFile, self).join(other, pb, msg, version_ids, ignore_missing) |
1225 | - self._save() |
1226 | - |
1227 | |
1228 | def _reweave(wa, wb, pb=None, msg=None): |
1229 | """Combine two weaves and return the result. |
Removes a lot of old code deprecated in 1.6 and previous versions.