Merge lp:~jelmer/brz/deprecation into lp:brz
- deprecation
- Merge into trunk
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merge reported by: | The Breezy Bot |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/brz/deprecation |
Merge into: | lp:brz |
Diff against target: |
2854 lines (+96/-1292) 64 files modified
breezy/atomicfile.py (+0/-1) breezy/branch.py (+0/-17) breezy/builtins.py (+7/-37) breezy/bundle/bundle_data.py (+3/-3) breezy/bzrdir.py (+0/-4) breezy/commit.py (+6/-32) breezy/config.py (+3/-162) breezy/conflicts.py (+11/-7) breezy/filters/__init__.py (+0/-31) breezy/gpg.py (+0/-95) breezy/hooks.py (+0/-1) breezy/inventory.py (+0/-4) breezy/lru_cache.py (+0/-11) breezy/merge.py (+0/-4) breezy/missing.py (+1/-11) breezy/mutabletree.py (+1/-3) breezy/osutils.py (+11/-60) breezy/plugins/weave_fmt/bzrdir.py (+2/-9) breezy/plugins/weave_fmt/repository.py (+0/-13) breezy/remote.py (+0/-12) breezy/repofmt/knitrepo.py (+0/-1) breezy/repository.py (+1/-16) breezy/revision.py (+7/-11) breezy/revisionspec.py (+9/-46) breezy/tag.py (+0/-26) breezy/tests/__init__.py (+2/-45) breezy/tests/blackbox/__init__.py (+0/-12) breezy/tests/blackbox/test_log.py (+0/-18) breezy/tests/per_branch/test_branch.py (+0/-19) breezy/tests/per_branch/test_check.py (+0/-1) breezy/tests/per_branch/test_get_revision_id_to_revno_map.py (+0/-1) breezy/tests/per_branch/test_hooks.py (+0/-1) breezy/tests/per_branch/test_push.py (+0/-1) breezy/tests/per_interbranch/test_push.py (+0/-1) breezy/tests/per_interrepository/test_interrepository.py (+0/-6) breezy/tests/per_inventory/basics.py (+0/-4) breezy/tests/per_repository/test_repository.py (+1/-8) breezy/tests/per_repository_vf/test_repository.py (+0/-1) breezy/tests/per_tree/test_tree.py (+0/-19) breezy/tests/per_workingtree/test_workingtree.py (+0/-1) breezy/tests/test_annotate.py (+0/-1) breezy/tests/test_atomicfile.py (+0/-1) breezy/tests/test_commit.py (+4/-11) breezy/tests/test_config.py (+8/-329) breezy/tests/test_hooks.py (+0/-3) breezy/tests/test_lru_cache.py (+0/-8) breezy/tests/test_osutils.py (+7/-43) breezy/tests/test_remote.py (+0/-1) breezy/tests/test_repository.py (+0/-1) breezy/tests/test_revisionspec.py (+0/-13) breezy/tests/test_selftest.py (+0/-13) breezy/tests/test_smart_add.py (+2/-3) breezy/tests/test_transform.py (+0/-1) breezy/transform.py (+0/-11) breezy/transport/__init__.py (+2/-19) breezy/transport/ftp/__init__.py (+0/-6) breezy/transport/gio_transport.py (+0/-6) breezy/transport/local.py (+0/-1) breezy/tree.py (+0/-23) breezy/vf_repository.py (+0/-15) breezy/weave.py (+0/-1) breezy/workingtree.py (+5/-9) breezy/workingtree_4.py (+0/-18) doc/en/release-notes/brz-3.0.txt (+3/-0) |
To merge this branch: | bzr merge lp:~jelmer/brz/deprecation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman | Approve | ||
Review via email: mp+324814@code.launchpad.net |
This proposal supersedes a proposal from 2017-05-30.
Commit message
Remove all deprecated arguments, functions and methods.
Description of the change
Remove all deprecated arguments, functions and methods.
To post a comment you must log in.
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Merging failed
http://
lp:~jelmer/brz/deprecation
updated
- 6639. By Jelmer Vernooij
-
Remove all deprecated arguments, functions and methods.
Merged from https:/
/code.launchpad .net/~jelmer/ brz/deprecation /+merge/ 324814
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'breezy/atomicfile.py' |
2 | --- breezy/atomicfile.py 2017-05-22 00:56:52 +0000 |
3 | +++ breezy/atomicfile.py 2017-05-30 21:16:02 +0000 |
4 | @@ -26,7 +26,6 @@ |
5 | from breezy import ( |
6 | errors, |
7 | osutils, |
8 | - symbol_versioning, |
9 | ) |
10 | """) |
11 | |
12 | |
13 | === modified file 'breezy/branch.py' |
14 | --- breezy/branch.py 2017-05-25 01:35:55 +0000 |
15 | +++ breezy/branch.py 2017-05-30 21:16:02 +0000 |
16 | @@ -67,10 +67,6 @@ |
17 | from .sixish import ( |
18 | BytesIO, |
19 | ) |
20 | -from .symbol_versioning import ( |
21 | - deprecated_in, |
22 | - deprecated_method, |
23 | - ) |
24 | from .trace import mutter, mutter_callsite, note, is_quiet |
25 | |
26 | |
27 | @@ -759,19 +755,6 @@ |
28 | """ |
29 | return None |
30 | |
31 | - @deprecated_method(deprecated_in((2, 5, 0))) |
32 | - def get_revision_delta(self, revno): |
33 | - """Return the delta for one revision. |
34 | - |
35 | - The delta is relative to its mainline predecessor, or the |
36 | - empty tree for revision 1. |
37 | - """ |
38 | - try: |
39 | - revid = self.get_rev_id(revno) |
40 | - except errors.NoSuchRevision: |
41 | - raise errors.InvalidRevisionNumber(revno) |
42 | - return self.repository.get_revision_delta(revid) |
43 | - |
44 | def get_stacked_on_url(self): |
45 | """Get the URL this branch is stacked against. |
46 | |
47 | |
48 | === modified file 'breezy/builtins.py' |
49 | --- breezy/builtins.py 2017-05-25 01:35:55 +0000 |
50 | +++ breezy/builtins.py 2017-05-30 21:16:02 +0000 |
51 | @@ -33,6 +33,7 @@ |
52 | bugtracker, |
53 | bundle, |
54 | btree_index, |
55 | + cache_utf8, |
56 | controldir, |
57 | directory_service, |
58 | delta, |
59 | @@ -48,6 +49,7 @@ |
60 | rename_map, |
61 | revision as _mod_revision, |
62 | static_tuple, |
63 | + symbol_versioning, |
64 | timestamp, |
65 | transport, |
66 | ui, |
67 | @@ -81,9 +83,6 @@ |
68 | text_type, |
69 | ) |
70 | from .trace import mutter, note, warning, is_quiet, get_verbosity_level |
71 | -from . import ( |
72 | - symbol_versioning, |
73 | - ) |
74 | |
75 | |
76 | def _get_branch_location(control_dir, possible_transports=None): |
77 | @@ -458,7 +457,7 @@ |
78 | try: |
79 | # TODO: jam 20060112 should cat-revision always output utf-8? |
80 | if revision_id is not None: |
81 | - revision_id = osutils.safe_revision_id(revision_id, warn=False) |
82 | + revision_id = cache_utf8.encode(revision_id) |
83 | try: |
84 | self.print_revision(revisions, revision_id) |
85 | except errors.NoSuchRevision: |
86 | @@ -1444,7 +1443,6 @@ |
87 | use_existing_dir=False, switch=False, bind=False, |
88 | files_from=None): |
89 | from breezy import switch as _mod_switch |
90 | - from .tag import _merge_tags_if_possible |
91 | if self.invoked_as in ['get', 'clone']: |
92 | ui.ui_factory.show_user_warning( |
93 | 'deprecated_command', |
94 | @@ -1523,7 +1521,8 @@ |
95 | to_repo = to_dir.create_repository() |
96 | to_repo.fetch(br_from.repository, revision_id=revision_id) |
97 | branch = br_from.sprout(to_dir, revision_id=revision_id) |
98 | - _merge_tags_if_possible(br_from, branch) |
99 | + br_from.tags.merge_to(branch.tags) |
100 | + |
101 | # If the source branch is stacked, the new branch may |
102 | # be stacked whether we asked for that explicitly or not. |
103 | # We therefore need a try/except here and not just 'if stacked:' |
104 | @@ -2744,7 +2743,6 @@ |
105 | match_author=None, |
106 | match_bugs=None, |
107 | omit_merges=False, |
108 | - include_merges=symbol_versioning.DEPRECATED_PARAMETER, |
109 | ): |
110 | from .log import ( |
111 | Logger, |
112 | @@ -2752,19 +2750,6 @@ |
113 | _get_info_for_log_files, |
114 | ) |
115 | direction = (forward and 'forward') or 'reverse' |
116 | - if symbol_versioning.deprecated_passed(include_merges): |
117 | - ui.ui_factory.show_user_warning( |
118 | - 'deprecated_command_option', |
119 | - deprecated_name='--include-merges', |
120 | - recommended_name='--include-merged', |
121 | - deprecated_in_version='2.5', |
122 | - command=self.invoked_as) |
123 | - if include_merged is None: |
124 | - include_merged = include_merges |
125 | - else: |
126 | - raise errors.BzrCommandError(gettext( |
127 | - '{0} and {1} are mutually exclusive').format( |
128 | - '--include-merges', '--include-merged')) |
129 | if include_merged is None: |
130 | include_merged = False |
131 | if (exclude_common_ancestry |
132 | @@ -4540,7 +4525,6 @@ |
133 | def _get_merger_from_branch(self, tree, location, revision, remember, |
134 | possible_transports, pb): |
135 | """Produce a merger from a location, assuming it refers to a branch.""" |
136 | - from .tag import _merge_tags_if_possible |
137 | # find the branch locations |
138 | other_loc, user_location = self._select_branch_location(tree, location, |
139 | revision, -1) |
140 | @@ -4580,7 +4564,7 @@ |
141 | tree.branch.set_submit_branch(other_branch.base) |
142 | # Merge tags (but don't set them in the master branch yet, the user |
143 | # might revert this merge). Commit will propagate them. |
144 | - _merge_tags_if_possible(other_branch, tree.branch, ignore_master=True) |
145 | + other_branch.tags.merge_to(tree.branch.tags, ignore_master=True) |
146 | merger = _mod_merge.Merger.from_revision_ids(pb, tree, |
147 | other_revision_id, base_revision_id, other_branch, base_branch) |
148 | if other_path != '': |
149 | @@ -4939,26 +4923,12 @@ |
150 | log_format=None, long=False, short=False, line=False, |
151 | show_ids=False, verbose=False, this=False, other=False, |
152 | include_merged=None, revision=None, my_revision=None, |
153 | - directory=u'.', |
154 | - include_merges=symbol_versioning.DEPRECATED_PARAMETER): |
155 | + directory=u'.'): |
156 | from breezy.missing import find_unmerged, iter_log_revisions |
157 | def message(s): |
158 | if not is_quiet(): |
159 | self.outf.write(s) |
160 | |
161 | - if symbol_versioning.deprecated_passed(include_merges): |
162 | - ui.ui_factory.show_user_warning( |
163 | - 'deprecated_command_option', |
164 | - deprecated_name='--include-merges', |
165 | - recommended_name='--include-merged', |
166 | - deprecated_in_version='2.5', |
167 | - command=self.invoked_as) |
168 | - if include_merged is None: |
169 | - include_merged = include_merges |
170 | - else: |
171 | - raise errors.BzrCommandError(gettext( |
172 | - '{0} and {1} are mutually exclusive').format( |
173 | - '--include-merges', '--include-merged')) |
174 | if include_merged is None: |
175 | include_merged = False |
176 | if this: |
177 | |
178 | === modified file 'breezy/bundle/bundle_data.py' |
179 | --- breezy/bundle/bundle_data.py 2017-05-25 01:35:55 +0000 |
180 | +++ breezy/bundle/bundle_data.py 2017-05-30 21:16:02 +0000 |
181 | @@ -23,6 +23,7 @@ |
182 | import pprint |
183 | |
184 | from .. import ( |
185 | + cache_utf8, |
186 | osutils, |
187 | timestamp, |
188 | ) |
189 | @@ -323,8 +324,7 @@ |
190 | if last_changed is not None: |
191 | # last_changed will be a Unicode string because of how it was |
192 | # read. Convert it back to utf8. |
193 | - changed_revision_id = osutils.safe_revision_id(last_changed, |
194 | - warn=False) |
195 | + changed_revision_id = cache_utf8.encode(last_changed) |
196 | else: |
197 | changed_revision_id = revision_id |
198 | bundle_tree.note_last_changed(path, changed_revision_id) |
199 | @@ -399,7 +399,7 @@ |
200 | ': %r' % extra) |
201 | # This will be Unicode because of how the stream is read. Turn it |
202 | # back into a utf8 file_id |
203 | - file_id = osutils.safe_file_id(info[1][8:], warn=False) |
204 | + file_id = cache_utf8.encode(info[1][8:]) |
205 | |
206 | bundle_tree.note_id(file_id, path, kind) |
207 | # this will be overridden in extra_info if executable is specified. |
208 | |
209 | === modified file 'breezy/bzrdir.py' |
210 | --- breezy/bzrdir.py 2017-05-22 00:56:52 +0000 |
211 | +++ breezy/bzrdir.py 2017-05-30 21:16:02 +0000 |
212 | @@ -72,10 +72,6 @@ |
213 | controldir, |
214 | registry, |
215 | ) |
216 | -from .symbol_versioning import ( |
217 | - deprecated_in, |
218 | - deprecated_method, |
219 | - ) |
220 | |
221 | |
222 | class BzrDir(controldir.ControlDir): |
223 | |
224 | === modified file 'breezy/commit.py' |
225 | --- breezy/commit.py 2017-05-22 00:56:52 +0000 |
226 | +++ breezy/commit.py 2017-05-30 21:16:02 +0000 |
227 | @@ -71,7 +71,6 @@ |
228 | ) |
229 | from .trace import mutter, note, is_quiet |
230 | from .inventory import Inventory, InventoryEntry, make_entry |
231 | -from . import symbol_versioning |
232 | from .urlutils import unescape_for_display |
233 | from .i18n import gettext |
234 | |
235 | @@ -79,11 +78,7 @@ |
236 | class NullCommitReporter(object): |
237 | """I report on progress of a commit.""" |
238 | |
239 | - def started(self, revno, revid, location=None): |
240 | - if location is None: |
241 | - symbol_versioning.warn("As of bzr 1.0 you must pass a location " |
242 | - "to started.", DeprecationWarning, |
243 | - stacklevel=2) |
244 | + def started(self, revno, revid, location): |
245 | pass |
246 | |
247 | def snapshot_change(self, change, path): |
248 | @@ -119,17 +114,10 @@ |
249 | return |
250 | self._note("%s %s", change, path) |
251 | |
252 | - def started(self, revno, rev_id, location=None): |
253 | - if location is not None: |
254 | - location = ' to: ' + unescape_for_display(location, 'utf-8') |
255 | - else: |
256 | - # When started was added, location was only made optional by |
257 | - # accident. Matt Nordhoff 20071129 |
258 | - symbol_versioning.warn("As of bzr 1.0 you must pass a location " |
259 | - "to started.", DeprecationWarning, |
260 | - stacklevel=2) |
261 | - location = '' |
262 | - self._note(gettext('Committing%s'), location) |
263 | + def started(self, revno, rev_id, location): |
264 | + self._note( |
265 | + gettext('Committing to: %s'), |
266 | + unescape_for_display(location, 'utf-8')) |
267 | |
268 | def completed(self, revno, rev_id): |
269 | self._note(gettext('Committed revision %d.'), revno) |
270 | @@ -176,7 +164,7 @@ |
271 | self.config_stack = config_stack |
272 | |
273 | @staticmethod |
274 | - def update_revprops(revprops, branch, authors=None, author=None, |
275 | + def update_revprops(revprops, branch, authors=None, |
276 | local=False, possible_master_transports=None): |
277 | if revprops is None: |
278 | revprops = {} |
279 | @@ -187,9 +175,6 @@ |
280 | local, |
281 | possible_master_transports) |
282 | if authors is not None: |
283 | - if author is not None: |
284 | - raise AssertionError('Specifying both author and authors ' |
285 | - 'is not allowed. Specify just authors instead') |
286 | if 'author' in revprops or 'authors' in revprops: |
287 | # XXX: maybe we should just accept one of them? |
288 | raise AssertionError('author property given twice') |
289 | @@ -199,17 +184,6 @@ |
290 | raise AssertionError('\\n is not a valid character ' |
291 | 'in an author identity') |
292 | revprops['authors'] = '\n'.join(authors) |
293 | - if author is not None: |
294 | - symbol_versioning.warn('The parameter author was deprecated' |
295 | - ' in version 1.13. Use authors instead', |
296 | - DeprecationWarning) |
297 | - if 'author' in revprops or 'authors' in revprops: |
298 | - # XXX: maybe we should just accept one of them? |
299 | - raise AssertionError('author property given twice') |
300 | - if '\n' in author: |
301 | - raise AssertionError('\\n is not a valid character ' |
302 | - 'in an author identity') |
303 | - revprops['authors'] = author |
304 | return revprops |
305 | |
306 | def commit(self, |
307 | |
308 | === modified file 'breezy/config.py' |
309 | --- breezy/config.py 2017-05-25 01:35:55 +0000 |
310 | +++ breezy/config.py 2017-05-30 21:16:02 +0000 |
311 | @@ -97,7 +97,6 @@ |
312 | lockdir, |
313 | mergetools, |
314 | osutils, |
315 | - symbol_versioning, |
316 | trace, |
317 | transport, |
318 | ui, |
319 | @@ -118,10 +117,6 @@ |
320 | text_type, |
321 | string_types, |
322 | ) |
323 | -from .symbol_versioning import ( |
324 | - deprecated_in, |
325 | - deprecated_method, |
326 | - ) |
327 | |
328 | |
329 | CHECK_IF_POSSIBLE=0 |
330 | @@ -445,65 +440,6 @@ |
331 | l = [l] |
332 | return l |
333 | |
334 | - @deprecated_method(deprecated_in((2, 5, 0))) |
335 | - def get_user_option_as_int_from_SI(self, option_name, default=None): |
336 | - """Get a generic option from a human readable size in SI units, e.g 10MB |
337 | - |
338 | - Accepted suffixes are K,M,G. It is case-insensitive and may be followed |
339 | - by a trailing b (i.e. Kb, MB). This is intended to be practical and not |
340 | - pedantic. |
341 | - |
342 | - :return Integer, expanded to its base-10 value if a proper SI unit is |
343 | - found. If the option doesn't exist, or isn't a value in |
344 | - SI units, return default (which defaults to None) |
345 | - """ |
346 | - val = self.get_user_option(option_name) |
347 | - if isinstance(val, list): |
348 | - val = val[0] |
349 | - if val is None: |
350 | - val = default |
351 | - else: |
352 | - p = re.compile("^(\d+)([kmg])*b*$", re.IGNORECASE) |
353 | - try: |
354 | - m = p.match(val) |
355 | - if m is not None: |
356 | - val = int(m.group(1)) |
357 | - if m.group(2) is not None: |
358 | - if m.group(2).lower() == 'k': |
359 | - val *= 10**3 |
360 | - elif m.group(2).lower() == 'm': |
361 | - val *= 10**6 |
362 | - elif m.group(2).lower() == 'g': |
363 | - val *= 10**9 |
364 | - else: |
365 | - ui.ui_factory.show_warning(gettext('Invalid config value for "{0}" ' |
366 | - ' value {1!r} is not an SI unit.').format( |
367 | - option_name, val)) |
368 | - val = default |
369 | - except TypeError: |
370 | - val = default |
371 | - return val |
372 | - |
373 | - @deprecated_method(deprecated_in((2, 5, 0))) |
374 | - def gpg_signing_command(self): |
375 | - """What program should be used to sign signatures?""" |
376 | - result = self._gpg_signing_command() |
377 | - if result is None: |
378 | - result = "gpg" |
379 | - return result |
380 | - |
381 | - def _gpg_signing_command(self): |
382 | - """See gpg_signing_command().""" |
383 | - return None |
384 | - |
385 | - @deprecated_method(deprecated_in((2, 5, 0))) |
386 | - def log_format(self): |
387 | - """What log format should be used""" |
388 | - result = self._log_format() |
389 | - if result is None: |
390 | - result = "long" |
391 | - return result |
392 | - |
393 | def _log_format(self): |
394 | """See log_format().""" |
395 | return None |
396 | @@ -521,25 +457,6 @@ |
397 | """See validate_signatures_in_log().""" |
398 | return None |
399 | |
400 | - @deprecated_method(deprecated_in((2, 5, 0))) |
401 | - def acceptable_keys(self): |
402 | - """Comma separated list of key patterns acceptable to |
403 | - verify-signatures command""" |
404 | - result = self._acceptable_keys() |
405 | - return result |
406 | - |
407 | - def _acceptable_keys(self): |
408 | - """See acceptable_keys().""" |
409 | - return None |
410 | - |
411 | - @deprecated_method(deprecated_in((2, 5, 0))) |
412 | - def post_commit(self): |
413 | - """An ordered list of python functions to call. |
414 | - |
415 | - Each function takes branch, rev_id as parameters. |
416 | - """ |
417 | - return self._post_commit() |
418 | - |
419 | def _post_commit(self): |
420 | """See Config.post_commit.""" |
421 | return None |
422 | @@ -573,46 +490,6 @@ |
423 | """ |
424 | self.username() |
425 | |
426 | - @deprecated_method(deprecated_in((2, 5, 0))) |
427 | - def signature_checking(self): |
428 | - """What is the current policy for signature checking?.""" |
429 | - policy = self._get_signature_checking() |
430 | - if policy is not None: |
431 | - return policy |
432 | - return CHECK_IF_POSSIBLE |
433 | - |
434 | - @deprecated_method(deprecated_in((2, 5, 0))) |
435 | - def signing_policy(self): |
436 | - """What is the current policy for signature checking?.""" |
437 | - policy = self._get_signing_policy() |
438 | - if policy is not None: |
439 | - return policy |
440 | - return SIGN_WHEN_REQUIRED |
441 | - |
442 | - @deprecated_method(deprecated_in((2, 5, 0))) |
443 | - def signature_needed(self): |
444 | - """Is a signature needed when committing ?.""" |
445 | - policy = self._get_signing_policy() |
446 | - if policy is None: |
447 | - policy = self._get_signature_checking() |
448 | - if policy is not None: |
449 | - #this warning should go away once check_signatures is |
450 | - #implemented (if not before) |
451 | - trace.warning("Please use create_signatures," |
452 | - " not check_signatures to set signing policy.") |
453 | - elif policy == SIGN_ALWAYS: |
454 | - return True |
455 | - return False |
456 | - |
457 | - @deprecated_method(deprecated_in((2, 5, 0))) |
458 | - def gpg_signing_key(self): |
459 | - """GPG user-id to sign commits""" |
460 | - key = self.get_user_option('gpg_signing_key') |
461 | - if key == "default" or key == None: |
462 | - return self.user_email() |
463 | - else: |
464 | - return key |
465 | - |
466 | def get_alias(self, value): |
467 | return self._get_alias(value) |
468 | |
469 | @@ -740,24 +617,14 @@ |
470 | class IniBasedConfig(Config): |
471 | """A configuration policy that draws from ini files.""" |
472 | |
473 | - def __init__(self, get_filename=symbol_versioning.DEPRECATED_PARAMETER, |
474 | - file_name=None): |
475 | + def __init__(self, file_name=None): |
476 | """Base class for configuration files using an ini-like syntax. |
477 | |
478 | :param file_name: The configuration file path. |
479 | """ |
480 | super(IniBasedConfig, self).__init__() |
481 | self.file_name = file_name |
482 | - if symbol_versioning.deprecated_passed(get_filename): |
483 | - symbol_versioning.warn( |
484 | - 'IniBasedConfig.__init__(get_filename) was deprecated in 2.3.' |
485 | - ' Use file_name instead.', |
486 | - DeprecationWarning, |
487 | - stacklevel=2) |
488 | - if get_filename is not None: |
489 | - self.file_name = get_filename() |
490 | - else: |
491 | - self.file_name = file_name |
492 | + self.file_name = file_name |
493 | self._content = None |
494 | self._parser = None |
495 | |
496 | @@ -783,15 +650,9 @@ |
497 | if save: |
498 | self._write_config_file() |
499 | |
500 | - def _get_parser(self, file=symbol_versioning.DEPRECATED_PARAMETER): |
501 | + def _get_parser(self): |
502 | if self._parser is not None: |
503 | return self._parser |
504 | - if symbol_versioning.deprecated_passed(file): |
505 | - symbol_versioning.warn( |
506 | - 'IniBasedConfig._get_parser(file=xxx) was deprecated in 2.3.' |
507 | - ' Use IniBasedConfig(_content=xxx) instead.', |
508 | - DeprecationWarning, |
509 | - stacklevel=2) |
510 | if self._content is not None: |
511 | co_input = self._content |
512 | elif self.file_name is None: |
513 | @@ -1277,26 +1138,6 @@ |
514 | |
515 | def _set_option_policy(self, section, option_name, option_policy): |
516 | """Set the policy for the given option name in the given section.""" |
517 | - # The old recurse=False option affects all options in the |
518 | - # section. To handle multiple policies in the section, we |
519 | - # need to convert it to a policy_norecurse key. |
520 | - try: |
521 | - recurse = self._get_parser()[section].as_bool('recurse') |
522 | - except KeyError: |
523 | - pass |
524 | - else: |
525 | - symbol_versioning.warn( |
526 | - 'The recurse option is deprecated as of 0.14. ' |
527 | - 'The section "%s" has been converted to use policies.' |
528 | - % section, |
529 | - DeprecationWarning) |
530 | - del self._get_parser()[section]['recurse'] |
531 | - if not recurse: |
532 | - for key in self._get_parser()[section].keys(): |
533 | - if not key.endswith(':policy'): |
534 | - self._get_parser()[section][key + |
535 | - ':policy'] = 'norecurse' |
536 | - |
537 | policy_key = option_name + ':policy' |
538 | policy_name = _policy_name[option_policy] |
539 | if policy_name is not None: |
540 | |
541 | === modified file 'breezy/conflicts.py' |
542 | --- breezy/conflicts.py 2017-05-22 00:56:52 +0000 |
543 | +++ breezy/conflicts.py 2017-05-30 21:16:02 +0000 |
544 | @@ -37,6 +37,7 @@ |
545 | from breezy.i18n import gettext, ngettext |
546 | """) |
547 | from . import ( |
548 | + cache_utf8, |
549 | commands, |
550 | option, |
551 | registry, |
552 | @@ -368,9 +369,11 @@ |
553 | |
554 | def __init__(self, path, file_id=None): |
555 | self.path = path |
556 | - # warn turned off, because the factory blindly transfers the Stanza |
557 | - # values to __init__ and Stanza is purely a Unicode api. |
558 | - self.file_id = osutils.safe_file_id(file_id, warn=False) |
559 | + # the factory blindly transfers the Stanza values to __init__ and |
560 | + # Stanza is purely a Unicode api. |
561 | + if isinstance(file_id, unicode): |
562 | + file_id = cache_utf8.encode(file_id) |
563 | + self.file_id = osutils.safe_file_id(file_id) |
564 | |
565 | def as_stanza(self): |
566 | s = rio.Stanza(type=self.typestring, path=self.path) |
567 | @@ -711,10 +714,11 @@ |
568 | conflict_file_id=None): |
569 | HandledConflict.__init__(self, action, path, file_id) |
570 | self.conflict_path = conflict_path |
571 | - # warn turned off, because the factory blindly transfers the Stanza |
572 | - # values to __init__. |
573 | - self.conflict_file_id = osutils.safe_file_id(conflict_file_id, |
574 | - warn=False) |
575 | + # the factory blindly transfers the Stanza values to __init__, |
576 | + # so they can be unicode. |
577 | + if isinstance(conflict_file_id, unicode): |
578 | + conflict_file_id = cache_utf8.encode(conflict_file_id) |
579 | + self.conflict_file_id = osutils.safe_file_id(conflict_file_id) |
580 | |
581 | def _cmp_list(self): |
582 | return HandledConflict._cmp_list(self) + [self.conflict_path, |
583 | |
584 | === modified file 'breezy/filters/__init__.py' |
585 | --- breezy/filters/__init__.py 2017-05-22 00:56:52 +0000 |
586 | +++ breezy/filters/__init__.py 2017-05-30 21:16:02 +0000 |
587 | @@ -52,10 +52,6 @@ |
588 | from ..sixish import ( |
589 | BytesIO, |
590 | ) |
591 | -from ..symbol_versioning import ( |
592 | - deprecated_function, |
593 | - deprecated_in, |
594 | - ) |
595 | |
596 | |
597 | class ContentFilter(object): |
598 | @@ -190,33 +186,6 @@ |
599 | _stack_cache = {} |
600 | |
601 | |
602 | -# XXX: This function doesn't have any tests. JRV 2012-03-29 |
603 | -@deprecated_function(deprecated_in((2, 6, 0))) |
604 | -def register_filter_stack_map(name, stack_map_lookup): |
605 | - """Register the filter stacks to use for various preference values. |
606 | - |
607 | - :param name: the preference/filter-stack name |
608 | - :param stack_map_lookup: a callable where |
609 | - the parameter is the preference value to match and |
610 | - the result is the matching stack of filters to use, |
611 | - or None if none. |
612 | - """ |
613 | - filter_stacks_registry.register(name, stack_map_lookup) |
614 | - |
615 | - |
616 | -# XXX: This function doesn't have any tests. JRV 2012-03-29 |
617 | -@deprecated_function(deprecated_in((2, 6, 0))) |
618 | -def lazy_register_filter_stack_map(name, module_name, member_name): |
619 | - """Lazily register the filter stacks to use for various preference values. |
620 | - |
621 | - :param name: the preference/filter-stack name |
622 | - :param module_name: The python path to the module of the filter stack map. |
623 | - :param member_name: The name of the stack_map_lookup callable |
624 | - in the module. |
625 | - """ |
626 | - filter_stacks_registry.register_lazy(name, module_name, member_name) |
627 | - |
628 | - |
629 | def _get_registered_names(): |
630 | """Get the list of names with filters registered.""" |
631 | # Note: We may want to intelligently order these later. |
632 | |
633 | === modified file 'breezy/gpg.py' |
634 | --- breezy/gpg.py 2017-05-22 00:56:52 +0000 |
635 | +++ breezy/gpg.py 2017-05-30 21:16:02 +0000 |
636 | @@ -42,10 +42,6 @@ |
637 | from .sixish import ( |
638 | BytesIO, |
639 | ) |
640 | -from .symbol_versioning import ( |
641 | - deprecated_in, |
642 | - deprecated_method, |
643 | - ) |
644 | |
645 | #verification results |
646 | SIGNATURE_VALID = 0 |
647 | @@ -144,30 +140,6 @@ |
648 | else: |
649 | self.acceptable_keys.append(pattern) |
650 | |
651 | - @deprecated_method(deprecated_in((2, 6, 0))) |
652 | - def do_verifications(self, revisions, repository): |
653 | - return bulk_verify_signatures(repository, revisions, self) |
654 | - |
655 | - @deprecated_method(deprecated_in((2, 6, 0))) |
656 | - def valid_commits_message(self, count): |
657 | - return valid_commits_message(count) |
658 | - |
659 | - @deprecated_method(deprecated_in((2, 6, 0))) |
660 | - def unknown_key_message(self, count): |
661 | - return unknown_key_message(count) |
662 | - |
663 | - @deprecated_method(deprecated_in((2, 6, 0))) |
664 | - def commit_not_valid_message(self, count): |
665 | - return commit_not_valid_message(count) |
666 | - |
667 | - @deprecated_method(deprecated_in((2, 6, 0))) |
668 | - def commit_not_signed_message(self, count): |
669 | - return commit_not_signed_message(count) |
670 | - |
671 | - @deprecated_method(deprecated_in((2, 6, 0))) |
672 | - def expired_commit_message(self, count): |
673 | - return expired_commit_message(count) |
674 | - |
675 | |
676 | def _set_gpg_tty(): |
677 | tty = os.environ.get('TTY') |
678 | @@ -360,73 +332,6 @@ |
679 | "No GnuPG key results for pattern: {0}" |
680 | ).format(pattern)) |
681 | |
682 | - @deprecated_method(deprecated_in((2, 6, 0))) |
683 | - def do_verifications(self, revisions, repository, |
684 | - process_events_callback=None): |
685 | - """do verifications on a set of revisions |
686 | - |
687 | - :param revisions: list of revision ids to verify |
688 | - :param repository: repository object |
689 | - :param process_events_callback: method to call for GUI frontends that |
690 | - want to keep their UI refreshed |
691 | - |
692 | - :return: count dictionary of results of each type, |
693 | - result list for each revision, |
694 | - boolean True if all results are verified successfully |
695 | - """ |
696 | - return bulk_verify_signatures(repository, revisions, self, |
697 | - process_events_callback) |
698 | - |
699 | - @deprecated_method(deprecated_in((2, 6, 0))) |
700 | - def verbose_valid_message(self, result): |
701 | - """takes a verify result and returns list of signed commits strings""" |
702 | - return verbose_valid_message(result) |
703 | - |
704 | - @deprecated_method(deprecated_in((2, 6, 0))) |
705 | - def verbose_not_valid_message(self, result, repo): |
706 | - """takes a verify result and returns list of not valid commit info""" |
707 | - return verbose_not_valid_message(result, repo) |
708 | - |
709 | - @deprecated_method(deprecated_in((2, 6, 0))) |
710 | - def verbose_not_signed_message(self, result, repo): |
711 | - """takes a verify result and returns list of not signed commit info""" |
712 | - return verbose_not_valid_message(result, repo) |
713 | - |
714 | - @deprecated_method(deprecated_in((2, 6, 0))) |
715 | - def verbose_missing_key_message(self, result): |
716 | - """takes a verify result and returns list of missing key info""" |
717 | - return verbose_missing_key_message(result) |
718 | - |
719 | - @deprecated_method(deprecated_in((2, 6, 0))) |
720 | - def verbose_expired_key_message(self, result, repo): |
721 | - """takes a verify result and returns list of expired key info""" |
722 | - return verbose_expired_key_message(result, repo) |
723 | - |
724 | - @deprecated_method(deprecated_in((2, 6, 0))) |
725 | - def valid_commits_message(self, count): |
726 | - """returns message for number of commits""" |
727 | - return valid_commits_message(count) |
728 | - |
729 | - @deprecated_method(deprecated_in((2, 6, 0))) |
730 | - def unknown_key_message(self, count): |
731 | - """returns message for number of commits""" |
732 | - return unknown_key_message(count) |
733 | - |
734 | - @deprecated_method(deprecated_in((2, 6, 0))) |
735 | - def commit_not_valid_message(self, count): |
736 | - """returns message for number of commits""" |
737 | - return commit_not_valid_message(count) |
738 | - |
739 | - @deprecated_method(deprecated_in((2, 6, 0))) |
740 | - def commit_not_signed_message(self, count): |
741 | - """returns message for number of commits""" |
742 | - return commit_not_signed_message(count) |
743 | - |
744 | - @deprecated_method(deprecated_in((2, 6, 0))) |
745 | - def expired_commit_message(self, count): |
746 | - """returns message for number of commits""" |
747 | - return expired_commit_message(count) |
748 | - |
749 | |
750 | def valid_commits_message(count): |
751 | """returns message for number of commits""" |
752 | |
753 | === modified file 'breezy/hooks.py' |
754 | --- breezy/hooks.py 2017-05-22 00:56:52 +0000 |
755 | +++ breezy/hooks.py 2017-05-30 21:16:02 +0000 |
756 | @@ -20,7 +20,6 @@ |
757 | |
758 | from . import ( |
759 | registry, |
760 | - symbol_versioning, |
761 | ) |
762 | from .lazy_import import lazy_import |
763 | lazy_import(globals(), """ |
764 | |
765 | === modified file 'breezy/inventory.py' |
766 | --- breezy/inventory.py 2017-05-22 00:56:52 +0000 |
767 | +++ breezy/inventory.py 2017-05-30 21:16:02 +0000 |
768 | @@ -50,10 +50,6 @@ |
769 | ) |
770 | |
771 | from .static_tuple import StaticTuple |
772 | -from .symbol_versioning import ( |
773 | - deprecated_in, |
774 | - deprecated_method, |
775 | - ) |
776 | |
777 | |
778 | class InventoryEntry(object): |
779 | |
780 | === modified file 'breezy/lru_cache.py' |
781 | --- breezy/lru_cache.py 2017-05-22 00:56:52 +0000 |
782 | +++ breezy/lru_cache.py 2017-05-30 21:16:02 +0000 |
783 | @@ -19,7 +19,6 @@ |
784 | from __future__ import absolute_import |
785 | |
786 | from . import ( |
787 | - symbol_versioning, |
788 | trace, |
789 | ) |
790 | |
791 | @@ -93,13 +92,6 @@ |
792 | def __len__(self): |
793 | return len(self._cache) |
794 | |
795 | - @symbol_versioning.deprecated_method( |
796 | - symbol_versioning.deprecated_in((2, 5, 0))) |
797 | - def add(self, key, value, cleanup=None): |
798 | - if cleanup is not None: |
799 | - raise ValueError("Per-node cleanup functions no longer supported") |
800 | - return self.__setitem__(key, value) |
801 | - |
802 | def __setitem__(self, key, value): |
803 | """Add a new value to the cache""" |
804 | if key is _null_key: |
805 | @@ -143,9 +135,6 @@ |
806 | """Get a new dict with the same key:value pairs as the cache""" |
807 | return dict((k, n.value) for k, n in self._cache.iteritems()) |
808 | |
809 | - items = symbol_versioning.deprecated_method( |
810 | - symbol_versioning.deprecated_in((2, 5, 0)))(as_dict) |
811 | - |
812 | def cleanup(self): |
813 | """Clear the cache until it shrinks to the requested size. |
814 | |
815 | |
816 | === modified file 'breezy/merge.py' |
817 | --- breezy/merge.py 2017-05-22 00:56:52 +0000 |
818 | +++ breezy/merge.py 2017-05-30 21:16:02 +0000 |
819 | @@ -48,10 +48,6 @@ |
820 | hooks, |
821 | registry, |
822 | ) |
823 | -from .symbol_versioning import ( |
824 | - deprecated_in, |
825 | - deprecated_method, |
826 | - ) |
827 | # TODO: Report back as changes are merged in |
828 | |
829 | |
830 | |
831 | === modified file 'breezy/missing.py' |
832 | --- breezy/missing.py 2017-05-22 00:56:52 +0000 |
833 | +++ breezy/missing.py 2017-05-30 21:16:02 +0000 |
834 | @@ -20,7 +20,6 @@ |
835 | |
836 | from . import ( |
837 | log, |
838 | - symbol_versioning, |
839 | ) |
840 | from . import revision as _mod_revision |
841 | |
842 | @@ -50,8 +49,7 @@ |
843 | |
844 | def find_unmerged(local_branch, remote_branch, restrict='all', |
845 | include_merged=None, backward=False, |
846 | - local_revid_range=None, remote_revid_range=None, |
847 | - include_merges=symbol_versioning.DEPRECATED_PARAMETER): |
848 | + local_revid_range=None, remote_revid_range=None): |
849 | """Find revisions from each side that have not been merged. |
850 | |
851 | :param local_branch: Compare the history of local_branch |
852 | @@ -69,18 +67,10 @@ |
853 | revisions (lower bound, upper bound) |
854 | :param remote_revid_range: Revision-id range for filtering remote_branch |
855 | revisions (lower bound, upper bound) |
856 | - :param include_merges: Deprecated historical alias for include_merged |
857 | |
858 | :return: A list of [(revno, revision_id)] for the mainline revisions on |
859 | each side. |
860 | """ |
861 | - if symbol_versioning.deprecated_passed(include_merges): |
862 | - symbol_versioning.warn( |
863 | - 'include_merges was deprecated in 2.5.' |
864 | - ' Use include_merged instead.', |
865 | - DeprecationWarning, stacklevel=2) |
866 | - if include_merged is None: |
867 | - include_merged = include_merges |
868 | if include_merged is None: |
869 | include_merged = False |
870 | local_branch.lock_read() |
871 | |
872 | === modified file 'breezy/mutabletree.py' |
873 | --- breezy/mutabletree.py 2017-05-25 01:35:55 +0000 |
874 | +++ breezy/mutabletree.py 2017-05-30 21:16:02 +0000 |
875 | @@ -189,8 +189,7 @@ |
876 | raise NotImplementedError(self.apply_inventory_delta) |
877 | |
878 | @needs_write_lock |
879 | - def commit(self, message=None, revprops=None, *args, |
880 | - **kwargs): |
881 | + def commit(self, message=None, revprops=None, *args, **kwargs): |
882 | # avoid circular imports |
883 | from breezy import commit |
884 | possible_master_transports=[] |
885 | @@ -198,7 +197,6 @@ |
886 | revprops, |
887 | self.branch, |
888 | kwargs.pop('authors', None), |
889 | - kwargs.pop('author', None), |
890 | kwargs.get('local', False), |
891 | possible_master_transports) |
892 | # args for wt.commit start at message from the Commit.commit method, |
893 | |
894 | === modified file 'breezy/osutils.py' |
895 | --- breezy/osutils.py 2017-05-30 19:39:52 +0000 |
896 | +++ breezy/osutils.py 2017-05-30 21:16:02 +0000 |
897 | @@ -46,7 +46,6 @@ |
898 | import unicodedata |
899 | |
900 | from breezy import ( |
901 | - cache_utf8, |
902 | config, |
903 | errors, |
904 | trace, |
905 | @@ -59,13 +58,6 @@ |
906 | PY3, |
907 | text_type, |
908 | ) |
909 | -from .symbol_versioning import ( |
910 | - DEPRECATED_PARAMETER, |
911 | - deprecated_function, |
912 | - deprecated_in, |
913 | - deprecated_passed, |
914 | - warn as warn_deprecated, |
915 | - ) |
916 | |
917 | from hashlib import ( |
918 | md5, |
919 | @@ -74,7 +66,7 @@ |
920 | |
921 | |
922 | import breezy |
923 | -from . import symbol_versioning, _fs_enc |
924 | +from . import _fs_enc |
925 | |
926 | |
927 | # Cross platform wall-clock time functionality with decent resolution. |
928 | @@ -1415,33 +1407,22 @@ |
929 | return unicode_or_utf8_string.encode('utf-8') |
930 | |
931 | |
932 | -_revision_id_warning = ('Unicode revision ids were deprecated in bzr 0.15.' |
933 | - ' Revision id generators should be creating utf8' |
934 | - ' revision ids.') |
935 | - |
936 | - |
937 | -def safe_revision_id(unicode_or_utf8_string, warn=True): |
938 | +def safe_revision_id(unicode_or_utf8_string): |
939 | """Revision ids should now be utf8, but at one point they were unicode. |
940 | |
941 | :param unicode_or_utf8_string: A possibly Unicode revision_id. (can also be |
942 | utf8 or None). |
943 | - :param warn: Functions that are sanitizing user data can set warn=False |
944 | :return: None or a utf8 revision id. |
945 | """ |
946 | if (unicode_or_utf8_string is None |
947 | or unicode_or_utf8_string.__class__ == str): |
948 | return unicode_or_utf8_string |
949 | - if warn: |
950 | - symbol_versioning.warn(_revision_id_warning, DeprecationWarning, |
951 | - stacklevel=2) |
952 | - return cache_utf8.encode(unicode_or_utf8_string) |
953 | - |
954 | - |
955 | -_file_id_warning = ('Unicode file ids were deprecated in bzr 0.15. File id' |
956 | - ' generators should be creating utf8 file ids.') |
957 | - |
958 | - |
959 | -def safe_file_id(unicode_or_utf8_string, warn=True): |
960 | + raise TypeError('Unicode revision ids are no longer supported. ' |
961 | + 'Revision id generators should be creating utf8 revision ' |
962 | + 'ids.') |
963 | + |
964 | + |
965 | +def safe_file_id(unicode_or_utf8_string): |
966 | """File ids should now be utf8, but at one point they were unicode. |
967 | |
968 | This is the same as safe_utf8, except it uses the cached encode functions |
969 | @@ -1449,16 +1430,13 @@ |
970 | |
971 | :param unicode_or_utf8_string: A possibly Unicode file_id. (can also be |
972 | utf8 or None). |
973 | - :param warn: Functions that are sanitizing user data can set warn=False |
974 | :return: None or a utf8 file id. |
975 | """ |
976 | if (unicode_or_utf8_string is None |
977 | or unicode_or_utf8_string.__class__ == str): |
978 | return unicode_or_utf8_string |
979 | - if warn: |
980 | - symbol_versioning.warn(_file_id_warning, DeprecationWarning, |
981 | - stacklevel=2) |
982 | - return cache_utf8.encode(unicode_or_utf8_string) |
983 | + raise TypeError('Unicode file ids are no longer supported. ' |
984 | + 'File id generators should be creating utf8 file ids.') |
985 | |
986 | |
987 | _platform_normalizes_filenames = False |
988 | @@ -2034,7 +2012,7 @@ |
989 | _cached_user_encoding = None |
990 | |
991 | |
992 | -def get_user_encoding(use_cache=DEPRECATED_PARAMETER): |
993 | +def get_user_encoding(): |
994 | """Find out what the preferred user encoding is. |
995 | |
996 | This is generally the encoding that is used for command line parameters |
997 | @@ -2044,9 +2022,6 @@ |
998 | :return: A string defining the preferred user encoding |
999 | """ |
1000 | global _cached_user_encoding |
1001 | - if deprecated_passed(use_cache): |
1002 | - warn_deprecated("use_cache should only have been used for tests", |
1003 | - DeprecationWarning, stacklevel=2) |
1004 | if _cached_user_encoding is not None: |
1005 | return _cached_user_encoding |
1006 | |
1007 | @@ -2319,30 +2294,6 @@ |
1008 | raise |
1009 | |
1010 | |
1011 | -@deprecated_function(deprecated_in((2, 2, 0))) |
1012 | -def re_compile_checked(re_string, flags=0, where=""): |
1013 | - """Return a compiled re, or raise a sensible error. |
1014 | - |
1015 | - This should only be used when compiling user-supplied REs. |
1016 | - |
1017 | - :param re_string: Text form of regular expression. |
1018 | - :param flags: eg re.IGNORECASE |
1019 | - :param where: Message explaining to the user the context where |
1020 | - it occurred, eg 'log search filter'. |
1021 | - """ |
1022 | - # from https://bugs.launchpad.net/bzr/+bug/251352 |
1023 | - try: |
1024 | - re_obj = re.compile(re_string, flags) |
1025 | - re_obj.search("") |
1026 | - return re_obj |
1027 | - except errors.InvalidPattern as e: |
1028 | - if where: |
1029 | - where = ' in ' + where |
1030 | - # despite the name 'error' is a type |
1031 | - raise errors.BzrCommandError('Invalid regular expression%s: %s' |
1032 | - % (where, e.msg)) |
1033 | - |
1034 | - |
1035 | if sys.platform == "win32": |
1036 | def getchar(): |
1037 | import msvcrt |
1038 | |
1039 | === modified file 'breezy/plugins/weave_fmt/bzrdir.py' |
1040 | --- breezy/plugins/weave_fmt/bzrdir.py 2017-05-25 01:35:55 +0000 |
1041 | +++ breezy/plugins/weave_fmt/bzrdir.py 2017-05-30 21:16:02 +0000 |
1042 | @@ -874,14 +874,10 @@ |
1043 | return self.transport |
1044 | raise errors.IncompatibleFormat(workingtree_format, self._format) |
1045 | |
1046 | - def needs_format_conversion(self, format=None): |
1047 | + def needs_format_conversion(self, format): |
1048 | """See ControlDir.needs_format_conversion().""" |
1049 | # if the format is not the same as the system default, |
1050 | # an upgrade is needed. |
1051 | - if format is None: |
1052 | - symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0)) |
1053 | - % 'needs_format_conversion(format=None)') |
1054 | - format = BzrDirFormat.get_default_format() |
1055 | return not isinstance(self._format, format.__class__) |
1056 | |
1057 | def open_branch(self, name=None, unsupported=False, |
1058 | @@ -945,11 +941,8 @@ |
1059 | """See ControlDir.create_repository.""" |
1060 | return self._format.repository_format.initialize(self, shared) |
1061 | |
1062 | - def needs_format_conversion(self, format=None): |
1063 | + def needs_format_conversion(self, format): |
1064 | """Format 4 dirs are always in need of conversion.""" |
1065 | - if format is None: |
1066 | - symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0)) |
1067 | - % 'needs_format_conversion(format=None)') |
1068 | return True |
1069 | |
1070 | def open_repository(self): |
1071 | |
1072 | === modified file 'breezy/plugins/weave_fmt/repository.py' |
1073 | --- breezy/plugins/weave_fmt/repository.py 2017-05-22 00:56:52 +0000 |
1074 | +++ breezy/plugins/weave_fmt/repository.py 2017-05-30 21:16:02 +0000 |
1075 | @@ -41,7 +41,6 @@ |
1076 | lockable_files, |
1077 | lockdir, |
1078 | osutils, |
1079 | - symbol_versioning, |
1080 | trace, |
1081 | tuned_gzip, |
1082 | urlutils, |
1083 | @@ -822,7 +821,6 @@ |
1084 | |
1085 | @needs_read_lock |
1086 | def search_missing_revision_ids(self, |
1087 | - revision_id=symbol_versioning.DEPRECATED_PARAMETER, |
1088 | find_ghosts=True, revision_ids=None, if_present_ids=None, |
1089 | limit=None): |
1090 | """See InterRepository.search_missing_revision_ids().""" |
1091 | @@ -837,17 +835,6 @@ |
1092 | # disk format scales terribly for push anyway due to rewriting |
1093 | # inventory.weave, this is considered acceptable. |
1094 | # - RBC 20060209 |
1095 | - if symbol_versioning.deprecated_passed(revision_id): |
1096 | - symbol_versioning.warn( |
1097 | - 'search_missing_revision_ids(revision_id=...) was ' |
1098 | - 'deprecated in 2.4. Use revision_ids=[...] instead.', |
1099 | - DeprecationWarning, stacklevel=2) |
1100 | - if revision_ids is not None: |
1101 | - raise AssertionError( |
1102 | - 'revision_ids is mutually exclusive with revision_id') |
1103 | - if revision_id is not None: |
1104 | - revision_ids = [revision_id] |
1105 | - del revision_id |
1106 | source_ids_set = self._present_source_revisions_for( |
1107 | revision_ids, if_present_ids) |
1108 | # source_ids is the worst possible case we may need to pull. |
1109 | |
1110 | === modified file 'breezy/remote.py' |
1111 | --- breezy/remote.py 2017-05-25 01:35:55 +0000 |
1112 | +++ breezy/remote.py 2017-05-30 21:16:02 +0000 |
1113 | @@ -37,7 +37,6 @@ |
1114 | repository as _mod_repository, |
1115 | revision as _mod_revision, |
1116 | static_tuple, |
1117 | - symbol_versioning, |
1118 | testament as _mod_testament, |
1119 | urlutils, |
1120 | vf_repository, |
1121 | @@ -2101,7 +2100,6 @@ |
1122 | |
1123 | @needs_read_lock |
1124 | def search_missing_revision_ids(self, other, |
1125 | - revision_id=symbol_versioning.DEPRECATED_PARAMETER, |
1126 | find_ghosts=True, revision_ids=None, if_present_ids=None, |
1127 | limit=None): |
1128 | """Return the revision ids that other has that this does not. |
1129 | @@ -2110,16 +2108,6 @@ |
1130 | |
1131 | revision_id: only return revision ids included by revision_id. |
1132 | """ |
1133 | - if symbol_versioning.deprecated_passed(revision_id): |
1134 | - symbol_versioning.warn( |
1135 | - 'search_missing_revision_ids(revision_id=...) was ' |
1136 | - 'deprecated in 2.4. Use revision_ids=[...] instead.', |
1137 | - DeprecationWarning, stacklevel=2) |
1138 | - if revision_ids is not None: |
1139 | - raise AssertionError( |
1140 | - 'revision_ids is mutually exclusive with revision_id') |
1141 | - if revision_id is not None: |
1142 | - revision_ids = [revision_id] |
1143 | inter_repo = _mod_repository.InterRepository.get(other, self) |
1144 | return inter_repo.search_missing_revision_ids( |
1145 | find_ghosts=find_ghosts, revision_ids=revision_ids, |
1146 | |
1147 | === modified file 'breezy/repofmt/knitrepo.py' |
1148 | --- breezy/repofmt/knitrepo.py 2017-05-22 00:56:52 +0000 |
1149 | +++ breezy/repofmt/knitrepo.py 2017-05-30 21:16:02 +0000 |
1150 | @@ -49,7 +49,6 @@ |
1151 | VersionedFileCommitBuilder, |
1152 | VersionedFileRootCommitBuilder, |
1153 | ) |
1154 | -from .. import symbol_versioning |
1155 | |
1156 | |
1157 | class _KnitParentsProvider(object): |
1158 | |
1159 | === modified file 'breezy/repository.py' |
1160 | --- breezy/repository.py 2017-05-25 01:35:55 +0000 |
1161 | +++ breezy/repository.py 2017-05-30 21:16:02 +0000 |
1162 | @@ -43,7 +43,6 @@ |
1163 | bzrdir, |
1164 | errors, |
1165 | registry, |
1166 | - symbol_versioning, |
1167 | ui, |
1168 | ) |
1169 | from .decorators import needs_read_lock, needs_write_lock, only_raises |
1170 | @@ -577,25 +576,14 @@ |
1171 | |
1172 | @needs_read_lock |
1173 | def search_missing_revision_ids(self, other, |
1174 | - revision_id=symbol_versioning.DEPRECATED_PARAMETER, |
1175 | find_ghosts=True, revision_ids=None, if_present_ids=None, |
1176 | limit=None): |
1177 | """Return the revision ids that other has that this does not. |
1178 | |
1179 | These are returned in topological order. |
1180 | |
1181 | - revision_id: only return revision ids included by revision_id. |
1182 | + revision_ids: only return revision ids included by revision_id. |
1183 | """ |
1184 | - if symbol_versioning.deprecated_passed(revision_id): |
1185 | - symbol_versioning.warn( |
1186 | - 'search_missing_revision_ids(revision_id=...) was ' |
1187 | - 'deprecated in 2.4. Use revision_ids=[...] instead.', |
1188 | - DeprecationWarning, stacklevel=3) |
1189 | - if revision_ids is not None: |
1190 | - raise AssertionError( |
1191 | - 'revision_ids is mutually exclusive with revision_id') |
1192 | - if revision_id is not None: |
1193 | - revision_ids = [revision_id] |
1194 | return InterRepository.get(other, self).search_missing_revision_ids( |
1195 | find_ghosts=find_ghosts, revision_ids=revision_ids, |
1196 | if_present_ids=if_present_ids, limit=limit) |
1197 | @@ -1662,13 +1650,10 @@ |
1198 | |
1199 | @needs_read_lock |
1200 | def search_missing_revision_ids(self, |
1201 | - revision_id=symbol_versioning.DEPRECATED_PARAMETER, |
1202 | find_ghosts=True, revision_ids=None, if_present_ids=None, |
1203 | limit=None): |
1204 | """Return the revision ids that source has that target does not. |
1205 | |
1206 | - :param revision_id: only return revision ids included by this |
1207 | - revision_id. |
1208 | :param revision_ids: return revision ids included by these |
1209 | revision_ids. NoSuchRevision will be raised if any of these |
1210 | revisions are not present. |
1211 | |
1212 | === modified file 'breezy/revision.py' |
1213 | --- breezy/revision.py 2017-05-22 00:56:52 +0000 |
1214 | +++ breezy/revision.py 2017-05-30 21:16:02 +0000 |
1215 | @@ -26,7 +26,6 @@ |
1216 | """) |
1217 | from . import ( |
1218 | errors, |
1219 | - symbol_versioning, |
1220 | ) |
1221 | from .osutils import contains_whitespace |
1222 | |
1223 | @@ -218,17 +217,14 @@ |
1224 | def ensure_null(revision_id): |
1225 | """Ensure only NULL_REVISION is used to represent the null revision""" |
1226 | if revision_id is None: |
1227 | - symbol_versioning.warn('NULL_REVISION should be used for the null' |
1228 | - ' revision instead of None, as of bzr 0.91.', |
1229 | - DeprecationWarning, stacklevel=2) |
1230 | - return NULL_REVISION |
1231 | - else: |
1232 | - return revision_id |
1233 | + raise ValueError( |
1234 | + 'NULL_REVISION should be used for the null' |
1235 | + ' revision instead of None.') |
1236 | + return revision_id |
1237 | |
1238 | |
1239 | def is_null(revision_id): |
1240 | if revision_id is None: |
1241 | - symbol_versioning.warn('NULL_REVISION should be used for the null' |
1242 | - ' revision instead of None, as of bzr 0.90.', |
1243 | - DeprecationWarning, stacklevel=2) |
1244 | - return revision_id in (None, NULL_REVISION) |
1245 | + raise ValueError('NULL_REVISION should be used for the null' |
1246 | + ' revision instead of None.') |
1247 | + return (revision_id == NULL_REVISION) |
1248 | |
1249 | === modified file 'breezy/revisionspec.py' |
1250 | --- breezy/revisionspec.py 2017-05-22 00:56:52 +0000 |
1251 | +++ breezy/revisionspec.py 2017-05-30 21:16:02 +0000 |
1252 | @@ -24,9 +24,9 @@ |
1253 | |
1254 | from breezy import ( |
1255 | branch as _mod_branch, |
1256 | + cache_utf8, |
1257 | osutils, |
1258 | revision, |
1259 | - symbol_versioning, |
1260 | workingtree, |
1261 | ) |
1262 | from breezy.i18n import gettext |
1263 | @@ -109,16 +109,11 @@ |
1264 | self.revno, self.rev_id, self.branch) |
1265 | |
1266 | @staticmethod |
1267 | - def from_revision_id(branch, revision_id, revs=symbol_versioning.DEPRECATED_PARAMETER): |
1268 | + def from_revision_id(branch, revision_id): |
1269 | """Construct a RevisionInfo given just the id. |
1270 | |
1271 | Use this if you don't know or care what the revno is. |
1272 | """ |
1273 | - if symbol_versioning.deprecated_passed(revs): |
1274 | - symbol_versioning.warn( |
1275 | - 'RevisionInfo.from_revision_id(revs) was deprecated in 2.5.', |
1276 | - DeprecationWarning, |
1277 | - stacklevel=2) |
1278 | return RevisionInfo(branch, revno=None, rev_id=revision_id) |
1279 | |
1280 | |
1281 | @@ -142,8 +137,6 @@ |
1282 | """ |
1283 | |
1284 | prefix = None |
1285 | - # wants_revision_history has been deprecated in 2.5. |
1286 | - wants_revision_history = False |
1287 | dwim_catchable_exceptions = (errors.InvalidRevisionSpec,) |
1288 | """Exceptions that RevisionSpec_dwim._match_on will catch. |
1289 | |
1290 | @@ -185,11 +178,9 @@ |
1291 | called directly. Only from RevisionSpec.from_string() |
1292 | """ |
1293 | if not _internal: |
1294 | - symbol_versioning.warn('Creating a RevisionSpec directly has' |
1295 | - ' been deprecated in version 0.11. Use' |
1296 | - ' RevisionSpec.from_string()' |
1297 | - ' instead.', |
1298 | - DeprecationWarning, stacklevel=2) |
1299 | + raise AssertionError( |
1300 | + 'Creating a RevisionSpec directly is not supported. ' |
1301 | + 'Use RevisionSpec.from_string() instead.') |
1302 | self.user_spec = spec |
1303 | if self.prefix and spec.startswith(self.prefix): |
1304 | spec = spec[len(self.prefix):] |
1305 | @@ -212,27 +203,7 @@ |
1306 | raise errors.InvalidRevisionSpec(self.spec, branch) |
1307 | |
1308 | def in_history(self, branch): |
1309 | - if branch: |
1310 | - if self.wants_revision_history: |
1311 | - symbol_versioning.warn( |
1312 | - "RevisionSpec.wants_revision_history was " |
1313 | - "deprecated in 2.5 (%s)." % self.__class__.__name__, |
1314 | - DeprecationWarning) |
1315 | - branch.lock_read() |
1316 | - try: |
1317 | - graph = branch.repository.get_graph() |
1318 | - revs = list(graph.iter_lefthand_ancestry( |
1319 | - branch.last_revision(), [revision.NULL_REVISION])) |
1320 | - finally: |
1321 | - branch.unlock() |
1322 | - revs.reverse() |
1323 | - else: |
1324 | - revs = None |
1325 | - else: |
1326 | - # this should never trigger. |
1327 | - # TODO: make it a deprecated code path. RBC 20060928 |
1328 | - revs = None |
1329 | - return self._match_on_and_check(branch, revs) |
1330 | + return self._match_on_and_check(branch, revs=None) |
1331 | |
1332 | # FIXME: in_history is somewhat broken, |
1333 | # it will return non-history revisions in many |
1334 | @@ -341,13 +312,6 @@ |
1335 | except rs_class.dwim_catchable_exceptions: |
1336 | pass |
1337 | |
1338 | - # Try the old (deprecated) dwim list: |
1339 | - for rs_class in dwim_revspecs: |
1340 | - try: |
1341 | - return self._try_spectype(rs_class, branch) |
1342 | - except rs_class.dwim_catchable_exceptions: |
1343 | - pass |
1344 | - |
1345 | # Well, I dunno what it is. Note that we don't try to keep track of the |
1346 | # first of last exception raised during the DWIM tries as none seems |
1347 | # really relevant. |
1348 | @@ -502,7 +466,9 @@ |
1349 | # self.spec comes straight from parsing the command line arguments, |
1350 | # so we expect it to be a Unicode string. Switch it to the internal |
1351 | # representation. |
1352 | - return osutils.safe_revision_id(self.spec, warn=False) |
1353 | + if isinstance(self.spec, unicode): |
1354 | + return cache_utf8.encode(self.spec) |
1355 | + return self.spec |
1356 | |
1357 | |
1358 | |
1359 | @@ -986,9 +952,6 @@ |
1360 | # The order in which we want to DWIM a revision spec without any prefix. |
1361 | # revno is always tried first and isn't listed here, this is used by |
1362 | # RevisionSpec_dwim._match_on |
1363 | -dwim_revspecs = symbol_versioning.deprecated_list( |
1364 | - symbol_versioning.deprecated_in((2, 4, 0)), "dwim_revspecs", []) |
1365 | - |
1366 | RevisionSpec_dwim.append_possible_revspec(RevisionSpec_tag) |
1367 | RevisionSpec_dwim.append_possible_revspec(RevisionSpec_revid) |
1368 | RevisionSpec_dwim.append_possible_revspec(RevisionSpec_date) |
1369 | |
1370 | === modified file 'breezy/tag.py' |
1371 | --- breezy/tag.py 2017-05-22 00:56:52 +0000 |
1372 | +++ breezy/tag.py 2017-05-30 21:16:02 +0000 |
1373 | @@ -38,7 +38,6 @@ |
1374 | bencode, |
1375 | cleanup, |
1376 | errors, |
1377 | - symbol_versioning, |
1378 | trace, |
1379 | ) |
1380 | """) |
1381 | @@ -356,31 +355,6 @@ |
1382 | return result, updates, conflicts |
1383 | |
1384 | |
1385 | -def _merge_tags_if_possible(from_branch, to_branch, ignore_master=False): |
1386 | - # Try hard to support merge_to implementations that don't expect |
1387 | - # 'ignore_master' (new in bzr 2.3). First, if the flag isn't set then we |
1388 | - # can safely avoid passing ignore_master at all. |
1389 | - if not ignore_master: |
1390 | - from_branch.tags.merge_to(to_branch.tags) |
1391 | - return |
1392 | - # If the flag is set, try to pass it, but be ready to catch TypeError. |
1393 | - try: |
1394 | - from_branch.tags.merge_to(to_branch.tags, ignore_master=ignore_master) |
1395 | - except TypeError: |
1396 | - # Probably this implementation of 'merge_to' is from a plugin that |
1397 | - # doesn't expect the 'ignore_master' keyword argument (e.g. bzr-svn |
1398 | - # 1.0.4). There's a small risk that the TypeError is actually caused |
1399 | - # by a completely different problem (which is why we don't catch it for |
1400 | - # the ignore_master=False case), but even then there's probably no harm |
1401 | - # in calling a second time. |
1402 | - symbol_versioning.warn( |
1403 | - symbol_versioning.deprecated_in((2,3)) % ( |
1404 | - "Tags.merge_to (of %r) that doesn't accept ignore_master kwarg" |
1405 | - % (from_branch.tags,),), |
1406 | - DeprecationWarning) |
1407 | - from_branch.tags.merge_to(to_branch.tags) |
1408 | - |
1409 | - |
1410 | def sort_natural(branch, tags): |
1411 | """Sort tags, with numeric substrings as numbers. |
1412 | |
1413 | |
1414 | === modified file 'breezy/tests/__init__.py' |
1415 | --- breezy/tests/__init__.py 2017-05-24 16:33:08 +0000 |
1416 | +++ breezy/tests/__init__.py 2017-05-30 21:16:02 +0000 |
1417 | @@ -93,19 +93,10 @@ |
1418 | text_type, |
1419 | ) |
1420 | from ..smart import client, request |
1421 | -from ..symbol_versioning import ( |
1422 | - deprecated_function, |
1423 | - deprecated_in, |
1424 | - deprecated_method, |
1425 | - ) |
1426 | from ..transport import ( |
1427 | memory, |
1428 | pathfilter, |
1429 | ) |
1430 | -from ..symbol_versioning import ( |
1431 | - deprecated_function, |
1432 | - deprecated_in, |
1433 | - ) |
1434 | from ..tests import ( |
1435 | fixtures, |
1436 | test_server, |
1437 | @@ -899,7 +890,8 @@ |
1438 | |
1439 | class StringIOWrapper(ui_testing.BytesIOWithEncoding): |
1440 | |
1441 | - @deprecated_method(deprecated_in((3, 0))) |
1442 | + @symbol_versioning.deprecated_method( |
1443 | + symbol_versioning.deprecated_in((3, 0))) |
1444 | def __init__(self, s=None): |
1445 | super(StringIOWrapper, self).__init__(s) |
1446 | |
1447 | @@ -1556,10 +1548,6 @@ |
1448 | else: |
1449 | self.assertEqual(expected_docstring, obj.__doc__) |
1450 | |
1451 | - @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4))) |
1452 | - def failUnlessExists(self, path): |
1453 | - return self.assertPathExists(path) |
1454 | - |
1455 | def assertPathExists(self, path): |
1456 | """Fail unless path or paths, which may be abs or relative, exist.""" |
1457 | if not isinstance(path, basestring): |
1458 | @@ -1569,10 +1557,6 @@ |
1459 | self.assertTrue(osutils.lexists(path), |
1460 | path + " does not exist") |
1461 | |
1462 | - @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4))) |
1463 | - def failIfExists(self, path): |
1464 | - return self.assertPathDoesNotExist(path) |
1465 | - |
1466 | def assertPathDoesNotExist(self, path): |
1467 | """Fail if path or paths, which may be abs or relative, exist.""" |
1468 | if not isinstance(path, basestring): |
1469 | @@ -4468,30 +4452,3 @@ |
1470 | return result |
1471 | except ImportError: |
1472 | pass |
1473 | - |
1474 | - |
1475 | -# API compatibility for old plugins; see bug 892622. |
1476 | -for name in [ |
1477 | - 'Feature', |
1478 | - 'HTTPServerFeature', |
1479 | - 'ModuleAvailableFeature', |
1480 | - 'HTTPSServerFeature', 'SymlinkFeature', 'HardlinkFeature', |
1481 | - 'OsFifoFeature', 'UnicodeFilenameFeature', |
1482 | - 'ByteStringNamedFilesystem', 'UTF8Filesystem', |
1483 | - 'BreakinFeature', 'CaseInsCasePresFilenameFeature', |
1484 | - 'CaseInsensitiveFilesystemFeature', 'case_sensitive_filesystem_feature', |
1485 | - 'posix_permissions_feature', |
1486 | - ]: |
1487 | - globals()[name] = _CompatabilityThunkFeature( |
1488 | - symbol_versioning.deprecated_in((2, 5, 0)), |
1489 | - 'breezy.tests', name, |
1490 | - name, 'breezy.tests.features') |
1491 | - |
1492 | - |
1493 | -for (old_name, new_name) in [ |
1494 | - ('UnicodeFilename', 'UnicodeFilenameFeature'), |
1495 | - ]: |
1496 | - globals()[name] = _CompatabilityThunkFeature( |
1497 | - symbol_versioning.deprecated_in((2, 5, 0)), |
1498 | - 'breezy.tests', old_name, |
1499 | - new_name, 'breezy.tests.features') |
1500 | |
1501 | === modified file 'breezy/tests/blackbox/__init__.py' |
1502 | --- breezy/tests/blackbox/__init__.py 2017-05-23 14:08:03 +0000 |
1503 | +++ breezy/tests/blackbox/__init__.py 2017-05-30 21:16:02 +0000 |
1504 | @@ -23,10 +23,6 @@ |
1505 | """ |
1506 | |
1507 | |
1508 | -from breezy.symbol_versioning import ( |
1509 | - deprecated_in, |
1510 | - deprecated_method, |
1511 | - ) |
1512 | from breezy import tests |
1513 | |
1514 | |
1515 | @@ -144,11 +140,3 @@ |
1516 | class ExternalBase(tests.TestCaseWithTransport): |
1517 | """Don't use this class anymore, use TestCaseWithTransport or similar""" |
1518 | |
1519 | - @deprecated_method(deprecated_in((2, 2, 0))) |
1520 | - def check_output(self, output, *args): |
1521 | - """Verify that the expected output matches what brz says. |
1522 | - |
1523 | - The output is supplied first, so that you can supply a variable |
1524 | - number of arguments to bzr. |
1525 | - """ |
1526 | - self.assertEqual(self.run_bzr(*args)[0], output) |
1527 | |
1528 | === modified file 'breezy/tests/blackbox/test_log.py' |
1529 | --- breezy/tests/blackbox/test_log.py 2017-05-24 16:33:08 +0000 |
1530 | +++ breezy/tests/blackbox/test_log.py 2017-05-30 21:16:02 +0000 |
1531 | @@ -562,24 +562,6 @@ |
1532 | self.assertLogRevnos(['-n0'], ['2', '1.1.2', '1.2.1', '1.1.1', '1'], |
1533 | working_dir='level0') |
1534 | |
1535 | - def test_include_merges(self): |
1536 | - # Confirm --include-merges gives the same output as -n0 |
1537 | - msg = ("The option '--include-merges' to 'brz log' " |
1538 | - "has been deprecated in brz 2.5. " |
1539 | - "Please use '--include-merged' instead.\n") |
1540 | - self.assertLogRevnos(['--include-merges'], |
1541 | - ['2', '1.1.2', '1.2.1', '1.1.1', '1'], |
1542 | - working_dir='level0', err=msg) |
1543 | - self.assertLogRevnos(['--include-merges'], |
1544 | - ['2', '1.1.2', '1.2.1', '1.1.1', '1'], |
1545 | - working_dir='level0', err=msg) |
1546 | - out_im, err_im = self.run_bzr('log --include-merges', |
1547 | - working_dir='level0') |
1548 | - out_n0, err_n0 = self.run_bzr('log -n0', working_dir='level0') |
1549 | - self.assertEqual(msg, err_im) |
1550 | - self.assertEqual('', err_n0) |
1551 | - self.assertEqual(out_im, out_n0) |
1552 | - |
1553 | def test_include_merged(self): |
1554 | # Confirm --include-merged gives the same output as -n0 |
1555 | expected = ['2', '1.1.2', '1.2.1', '1.1.1', '1'] |
1556 | |
1557 | === modified file 'breezy/tests/per_branch/test_branch.py' |
1558 | --- breezy/tests/per_branch/test_branch.py 2017-05-21 18:10:28 +0000 |
1559 | +++ breezy/tests/per_branch/test_branch.py 2017-05-30 21:16:02 +0000 |
1560 | @@ -33,7 +33,6 @@ |
1561 | repository, |
1562 | revision, |
1563 | shelf, |
1564 | - symbol_versioning, |
1565 | tests, |
1566 | ) |
1567 | from breezy.tests import ( |
1568 | @@ -107,24 +106,6 @@ |
1569 | self.addCleanup(tree.unlock) |
1570 | self.assertEqual(tree.get_file_text('foo-id'), 'hello') |
1571 | |
1572 | - def test_get_revision_delta(self): |
1573 | - tree_a = self.make_branch_and_tree('a') |
1574 | - self.build_tree(['a/foo']) |
1575 | - tree_a.add('foo', 'file1') |
1576 | - tree_a.commit('rev1', rev_id='rev1') |
1577 | - self.build_tree(['a/vla']) |
1578 | - tree_a.add('vla', 'file2') |
1579 | - tree_a.commit('rev2', rev_id='rev2') |
1580 | - |
1581 | - delta = self.applyDeprecated(symbol_versioning.deprecated_in( |
1582 | - (2, 5, 0)), tree_a.branch.get_revision_delta, 1) |
1583 | - self.assertIsInstance(delta, _mod_delta.TreeDelta) |
1584 | - self.assertEqual([('foo', 'file1', 'file')], delta.added) |
1585 | - delta = self.applyDeprecated(symbol_versioning.deprecated_in( |
1586 | - (2, 5, 0)), tree_a.branch.get_revision_delta, 2) |
1587 | - self.assertIsInstance(delta, _mod_delta.TreeDelta) |
1588 | - self.assertEqual([('vla', 'file2', 'file')], delta.added) |
1589 | - |
1590 | def get_unbalanced_tree_pair(self): |
1591 | """Return two branches, a and b, with one file in a.""" |
1592 | tree_a = self.make_branch_and_tree('a') |
1593 | |
1594 | === modified file 'breezy/tests/per_branch/test_check.py' |
1595 | --- breezy/tests/per_branch/test_check.py 2017-05-22 00:56:52 +0000 |
1596 | +++ breezy/tests/per_branch/test_check.py 2017-05-30 21:16:02 +0000 |
1597 | @@ -25,7 +25,6 @@ |
1598 | from ...sixish import ( |
1599 | BytesIO, |
1600 | ) |
1601 | -from ...symbol_versioning import deprecated_in |
1602 | from . import TestCaseWithBranch |
1603 | |
1604 | |
1605 | |
1606 | === modified file 'breezy/tests/per_branch/test_get_revision_id_to_revno_map.py' |
1607 | --- breezy/tests/per_branch/test_get_revision_id_to_revno_map.py 2017-05-21 18:10:28 +0000 |
1608 | +++ breezy/tests/per_branch/test_get_revision_id_to_revno_map.py 2017-05-30 21:16:02 +0000 |
1609 | @@ -16,7 +16,6 @@ |
1610 | |
1611 | """Tests for Branch.get_revision_id_to_revno_map()""" |
1612 | |
1613 | -from breezy.symbol_versioning import deprecated_in |
1614 | from breezy.tests.per_branch import TestCaseWithBranch |
1615 | |
1616 | |
1617 | |
1618 | === modified file 'breezy/tests/per_branch/test_hooks.py' |
1619 | --- breezy/tests/per_branch/test_hooks.py 2017-05-21 18:10:28 +0000 |
1620 | +++ breezy/tests/per_branch/test_hooks.py 2017-05-30 21:16:02 +0000 |
1621 | @@ -23,7 +23,6 @@ |
1622 | revision, |
1623 | tests, |
1624 | ) |
1625 | -from breezy.symbol_versioning import deprecated_in |
1626 | from breezy.tests import test_server |
1627 | |
1628 | class ChangeBranchTipTestCase(tests.TestCaseWithMemoryTransport): |
1629 | |
1630 | === modified file 'breezy/tests/per_branch/test_push.py' |
1631 | --- breezy/tests/per_branch/test_push.py 2017-05-22 00:56:52 +0000 |
1632 | +++ breezy/tests/per_branch/test_push.py 2017-05-30 21:16:02 +0000 |
1633 | @@ -27,7 +27,6 @@ |
1634 | memorytree, |
1635 | push, |
1636 | revision, |
1637 | - symbol_versioning, |
1638 | tests, |
1639 | transport, |
1640 | ) |
1641 | |
1642 | === modified file 'breezy/tests/per_interbranch/test_push.py' |
1643 | --- breezy/tests/per_interbranch/test_push.py 2017-05-22 00:56:52 +0000 |
1644 | +++ breezy/tests/per_interbranch/test_push.py 2017-05-30 21:16:02 +0000 |
1645 | @@ -27,7 +27,6 @@ |
1646 | controldir, |
1647 | errors, |
1648 | push, |
1649 | - symbol_versioning, |
1650 | tests, |
1651 | vf_repository, |
1652 | ) |
1653 | |
1654 | === modified file 'breezy/tests/per_interrepository/test_interrepository.py' |
1655 | --- breezy/tests/per_interrepository/test_interrepository.py 2017-05-22 00:56:52 +0000 |
1656 | +++ breezy/tests/per_interrepository/test_interrepository.py 2017-05-30 21:16:02 +0000 |
1657 | @@ -112,12 +112,6 @@ |
1658 | self.assertRaises(errors.NoSuchRevision, |
1659 | repo_b.search_missing_revision_ids, repo_a, revision_ids=['pizza'], |
1660 | find_ghosts=False) |
1661 | - self.callDeprecated( |
1662 | - ['search_missing_revision_ids(revision_id=...) was deprecated in ' |
1663 | - '2.4. Use revision_ids=[...] instead.'], |
1664 | - self.assertRaises, errors.NoSuchRevision, |
1665 | - repo_b.search_missing_revision_ids, repo_a, revision_id='pizza', |
1666 | - find_ghosts=False) |
1667 | |
1668 | def test_search_missing_revision_ids_revision_limited(self): |
1669 | # revision ids in repository A that are not referenced by the |
1670 | |
1671 | === modified file 'breezy/tests/per_inventory/basics.py' |
1672 | --- breezy/tests/per_inventory/basics.py 2017-05-21 18:10:28 +0000 |
1673 | +++ breezy/tests/per_inventory/basics.py 2017-05-30 21:16:02 +0000 |
1674 | @@ -35,10 +35,6 @@ |
1675 | |
1676 | from breezy.tests.per_inventory import TestCaseWithInventory |
1677 | |
1678 | -from breezy.symbol_versioning import ( |
1679 | - deprecated_in, |
1680 | - ) |
1681 | - |
1682 | |
1683 | class TestInventory(TestCaseWithInventory): |
1684 | |
1685 | |
1686 | === modified file 'breezy/tests/per_repository/test_repository.py' |
1687 | --- breezy/tests/per_repository/test_repository.py 2017-05-24 16:21:50 +0000 |
1688 | +++ breezy/tests/per_repository/test_repository.py 2017-05-30 21:16:02 +0000 |
1689 | @@ -258,14 +258,7 @@ |
1690 | list(tree.list_files(include_root=True))) |
1691 | finally: |
1692 | tree.unlock() |
1693 | - tree = self.callDeprecated(['NULL_REVISION should be used for the null' |
1694 | - ' revision instead of None, as of bzr 0.91.'], |
1695 | - wt.branch.repository.revision_tree, None) |
1696 | - tree.lock_read() |
1697 | - try: |
1698 | - self.assertEqual([], list(tree.list_files(include_root=True))) |
1699 | - finally: |
1700 | - tree.unlock() |
1701 | + self.assertRaises(ValueError, wt.branch.repository.revision_tree, None) |
1702 | tree = wt.branch.repository.revision_tree(_mod_revision.NULL_REVISION) |
1703 | tree.lock_read() |
1704 | try: |
1705 | |
1706 | === modified file 'breezy/tests/per_repository_vf/test_repository.py' |
1707 | --- breezy/tests/per_repository_vf/test_repository.py 2017-05-22 00:56:52 +0000 |
1708 | +++ breezy/tests/per_repository_vf/test_repository.py 2017-05-30 21:16:02 +0000 |
1709 | @@ -27,7 +27,6 @@ |
1710 | vf_repository, |
1711 | ) |
1712 | |
1713 | -from breezy.symbol_versioning import deprecated_in |
1714 | from breezy.tests.matchers import MatchesAncestry |
1715 | from breezy.tests.per_repository_vf import ( |
1716 | TestCaseWithRepository, |
1717 | |
1718 | === modified file 'breezy/tests/per_tree/test_tree.py' |
1719 | --- breezy/tests/per_tree/test_tree.py 2017-05-22 00:56:52 +0000 |
1720 | +++ breezy/tests/per_tree/test_tree.py 2017-05-30 21:16:02 +0000 |
1721 | @@ -24,9 +24,6 @@ |
1722 | ) |
1723 | from breezy.tests import TestSkipped |
1724 | from breezy.tests.per_tree import TestCaseWithTree |
1725 | -from breezy.symbol_versioning import ( |
1726 | - deprecated_in, |
1727 | - ) |
1728 | |
1729 | |
1730 | class TestAnnotate(TestCaseWithTree): |
1731 | @@ -284,22 +281,6 @@ |
1732 | self.assertTrue(tree.has_id('file-id')) |
1733 | self.assertFalse(tree.has_id('dir-id')) |
1734 | |
1735 | - def test___contains__(self): |
1736 | - work_tree = self.make_branch_and_tree('tree') |
1737 | - self.build_tree(['tree/file']) |
1738 | - work_tree.add('file', 'file-id') |
1739 | - tree = self._convert_tree(work_tree) |
1740 | - tree.lock_read() |
1741 | - self.addCleanup(tree.unlock) |
1742 | - self.assertTrue( |
1743 | - self.applyDeprecated( |
1744 | - deprecated_in((2, 4, 0)), |
1745 | - tree.__contains__, 'file-id')) |
1746 | - self.assertFalse( |
1747 | - self.applyDeprecated( |
1748 | - deprecated_in((2, 4, 0)), |
1749 | - tree.__contains__, 'dir-id')) |
1750 | - |
1751 | |
1752 | class TestExtras(TestCaseWithTree): |
1753 | |
1754 | |
1755 | === modified file 'breezy/tests/per_workingtree/test_workingtree.py' |
1756 | --- breezy/tests/per_workingtree/test_workingtree.py 2017-05-22 00:56:52 +0000 |
1757 | +++ breezy/tests/per_workingtree/test_workingtree.py 2017-05-30 21:16:02 +0000 |
1758 | @@ -27,7 +27,6 @@ |
1759 | errors, |
1760 | osutils, |
1761 | revision as _mod_revision, |
1762 | - symbol_versioning, |
1763 | tests, |
1764 | trace, |
1765 | urlutils, |
1766 | |
1767 | === modified file 'breezy/tests/test_annotate.py' |
1768 | --- breezy/tests/test_annotate.py 2017-05-22 00:56:52 +0000 |
1769 | +++ breezy/tests/test_annotate.py 2017-05-30 21:16:02 +0000 |
1770 | @@ -20,7 +20,6 @@ |
1771 | |
1772 | from .. import ( |
1773 | annotate, |
1774 | - symbol_versioning, |
1775 | tests, |
1776 | ) |
1777 | from ..sixish import ( |
1778 | |
1779 | === modified file 'breezy/tests/test_atomicfile.py' |
1780 | --- breezy/tests/test_atomicfile.py 2017-05-22 00:56:52 +0000 |
1781 | +++ breezy/tests/test_atomicfile.py 2017-05-30 21:16:02 +0000 |
1782 | @@ -24,7 +24,6 @@ |
1783 | atomicfile, |
1784 | errors, |
1785 | osutils, |
1786 | - symbol_versioning, |
1787 | ) |
1788 | from . import TestCaseInTempDir, TestSkipped |
1789 | |
1790 | |
1791 | === modified file 'breezy/tests/test_commit.py' |
1792 | --- breezy/tests/test_commit.py 2017-05-22 00:56:52 +0000 |
1793 | +++ breezy/tests/test_commit.py 2017-05-30 21:16:02 +0000 |
1794 | @@ -790,13 +790,13 @@ |
1795 | self.assertFalse('authors' in rev.properties) |
1796 | |
1797 | def test_commit_author(self): |
1798 | - """Passing a non-empty author kwarg to MutableTree.commit should add |
1799 | + """Passing a non-empty authors kwarg to MutableTree.commit should add |
1800 | the 'author' revision property. |
1801 | """ |
1802 | tree = self.make_branch_and_tree('foo') |
1803 | - rev_id = self.callDeprecated(['The parameter author was ' |
1804 | - 'deprecated in version 1.13. Use authors instead'], |
1805 | - tree.commit, 'commit 1', author='John Doe <jdoe@example.com>') |
1806 | + rev_id = tree.commit( |
1807 | + 'commit 1', |
1808 | + authors=['John Doe <jdoe@example.com>']) |
1809 | rev = tree.branch.repository.get_revision(rev_id) |
1810 | self.assertEqual('John Doe <jdoe@example.com>', |
1811 | rev.properties['authors']) |
1812 | @@ -820,13 +820,6 @@ |
1813 | 'Jane Rey <jrey@example.com>', rev.properties['authors']) |
1814 | self.assertFalse('author' in rev.properties) |
1815 | |
1816 | - def test_author_and_authors_incompatible(self): |
1817 | - tree = self.make_branch_and_tree('foo') |
1818 | - self.assertRaises(AssertionError, tree.commit, 'commit 1', |
1819 | - authors=['John Doe <jdoe@example.com>', |
1820 | - 'Jane Rey <jrey@example.com>'], |
1821 | - author="Jack Me <jme@example.com>") |
1822 | - |
1823 | def test_author_with_newline_rejected(self): |
1824 | tree = self.make_branch_and_tree('foo') |
1825 | self.assertRaises(AssertionError, tree.commit, 'commit 1', |
1826 | |
1827 | === modified file 'breezy/tests/test_config.py' |
1828 | --- breezy/tests/test_config.py 2017-05-22 00:56:52 +0000 |
1829 | +++ breezy/tests/test_config.py 2017-05-30 21:16:02 +0000 |
1830 | @@ -42,9 +42,6 @@ |
1831 | from ..sixish import ( |
1832 | BytesIO, |
1833 | ) |
1834 | -from ..symbol_versioning import ( |
1835 | - deprecated_in, |
1836 | - ) |
1837 | from ..transport import remote as transport_remote |
1838 | from . import ( |
1839 | features, |
1840 | @@ -488,60 +485,10 @@ |
1841 | my_config.username()) |
1842 | self.assertEqual(['_get_user_id'], my_config._calls) |
1843 | |
1844 | - def test_signatures_default(self): |
1845 | - my_config = config.Config() |
1846 | - self.assertFalse( |
1847 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1848 | - my_config.signature_needed)) |
1849 | - self.assertEqual(config.CHECK_IF_POSSIBLE, |
1850 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1851 | - my_config.signature_checking)) |
1852 | - self.assertEqual(config.SIGN_WHEN_REQUIRED, |
1853 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1854 | - my_config.signing_policy)) |
1855 | - |
1856 | - def test_signatures_template_method(self): |
1857 | - my_config = InstrumentedConfig() |
1858 | - self.assertEqual(config.CHECK_NEVER, |
1859 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1860 | - my_config.signature_checking)) |
1861 | - self.assertEqual(['_get_signature_checking'], my_config._calls) |
1862 | - |
1863 | - def test_signatures_template_method_none(self): |
1864 | - my_config = InstrumentedConfig() |
1865 | - my_config._signatures = None |
1866 | - self.assertEqual(config.CHECK_IF_POSSIBLE, |
1867 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1868 | - my_config.signature_checking)) |
1869 | - self.assertEqual(['_get_signature_checking'], my_config._calls) |
1870 | - |
1871 | - def test_gpg_signing_command_default(self): |
1872 | - my_config = config.Config() |
1873 | - self.assertEqual('gpg', |
1874 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1875 | - my_config.gpg_signing_command)) |
1876 | - |
1877 | def test_get_user_option_default(self): |
1878 | my_config = config.Config() |
1879 | self.assertEqual(None, my_config.get_user_option('no_option')) |
1880 | |
1881 | - def test_post_commit_default(self): |
1882 | - my_config = config.Config() |
1883 | - self.assertEqual(None, self.applyDeprecated(deprecated_in((2, 5, 0)), |
1884 | - my_config.post_commit)) |
1885 | - |
1886 | - |
1887 | - def test_log_format_default(self): |
1888 | - my_config = config.Config() |
1889 | - self.assertEqual('long', |
1890 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1891 | - my_config.log_format)) |
1892 | - |
1893 | - def test_acceptable_keys_default(self): |
1894 | - my_config = config.Config() |
1895 | - self.assertEqual(None, self.applyDeprecated(deprecated_in((2, 5, 0)), |
1896 | - my_config.acceptable_keys)) |
1897 | - |
1898 | def test_validate_signatures_in_log_default(self): |
1899 | my_config = config.Config() |
1900 | self.assertEqual(False, my_config.validate_signatures_in_log()) |
1901 | @@ -656,21 +603,6 @@ |
1902 | self.assertTrue(isinstance(self.uid, int)) |
1903 | self.assertTrue(isinstance(self.gid, int)) |
1904 | |
1905 | - def test_get_filename_parameter_is_deprecated_(self): |
1906 | - conf = self.callDeprecated([ |
1907 | - 'IniBasedConfig.__init__(get_filename) was deprecated in 2.3.' |
1908 | - ' Use file_name instead.'], |
1909 | - config.IniBasedConfig, lambda: 'ini.conf') |
1910 | - self.assertEqual('ini.conf', conf.file_name) |
1911 | - |
1912 | - def test_get_parser_file_parameter_is_deprecated_(self): |
1913 | - config_file = BytesIO(sample_config_text.encode('utf-8')) |
1914 | - conf = config.IniBasedConfig.from_string(sample_config_text) |
1915 | - conf = self.callDeprecated([ |
1916 | - 'IniBasedConfig._get_parser(file=xxx) was deprecated in 2.3.' |
1917 | - ' Use IniBasedConfig(_content=xxx) instead.'], |
1918 | - conf._get_parser, file=config_file) |
1919 | - |
1920 | |
1921 | class TestIniConfigSaving(tests.TestCaseInTempDir): |
1922 | |
1923 | @@ -1004,30 +936,6 @@ |
1924 | # automatically cast to list |
1925 | self.assertEqual(['x'], get_list('one_item')) |
1926 | |
1927 | - def test_get_user_option_as_int_from_SI(self): |
1928 | - conf, parser = self.make_config_parser(""" |
1929 | -plain = 100 |
1930 | -si_k = 5k, |
1931 | -si_kb = 5kb, |
1932 | -si_m = 5M, |
1933 | -si_mb = 5MB, |
1934 | -si_g = 5g, |
1935 | -si_gb = 5gB, |
1936 | -""") |
1937 | - def get_si(s, default=None): |
1938 | - return self.applyDeprecated( |
1939 | - deprecated_in((2, 5, 0)), |
1940 | - conf.get_user_option_as_int_from_SI, s, default) |
1941 | - self.assertEqual(100, get_si('plain')) |
1942 | - self.assertEqual(5000, get_si('si_k')) |
1943 | - self.assertEqual(5000, get_si('si_kb')) |
1944 | - self.assertEqual(5000000, get_si('si_m')) |
1945 | - self.assertEqual(5000000, get_si('si_mb')) |
1946 | - self.assertEqual(5000000000, get_si('si_g')) |
1947 | - self.assertEqual(5000000000, get_si('si_gb')) |
1948 | - self.assertEqual(None, get_si('non-exist')) |
1949 | - self.assertEqual(42, get_si('non-exist-with-default', 42)) |
1950 | - |
1951 | |
1952 | class TestSupressWarning(TestIniConfig): |
1953 | |
1954 | @@ -1181,6 +1089,14 @@ |
1955 | |
1956 | class TestGlobalConfigItems(tests.TestCaseInTempDir): |
1957 | |
1958 | + def _get_empty_config(self): |
1959 | + my_config = config.GlobalConfig() |
1960 | + return my_config |
1961 | + |
1962 | + def _get_sample_config(self): |
1963 | + my_config = config.GlobalConfig.from_string(sample_config_text) |
1964 | + return my_config |
1965 | + |
1966 | def test_user_id(self): |
1967 | my_config = config.GlobalConfig.from_string(sample_config_text) |
1968 | self.assertEqual(u"Erik B\u00e5gfors <erik@bagfors.nu>", |
1969 | @@ -1190,68 +1106,6 @@ |
1970 | my_config = config.GlobalConfig() |
1971 | self.assertEqual(None, my_config._get_user_id()) |
1972 | |
1973 | - def test_signatures_always(self): |
1974 | - my_config = config.GlobalConfig.from_string(sample_always_signatures) |
1975 | - self.assertEqual(config.CHECK_NEVER, |
1976 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1977 | - my_config.signature_checking)) |
1978 | - self.assertEqual(config.SIGN_ALWAYS, |
1979 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1980 | - my_config.signing_policy)) |
1981 | - self.assertEqual(True, |
1982 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1983 | - my_config.signature_needed)) |
1984 | - |
1985 | - def test_signatures_if_possible(self): |
1986 | - my_config = config.GlobalConfig.from_string(sample_maybe_signatures) |
1987 | - self.assertEqual(config.CHECK_NEVER, |
1988 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1989 | - my_config.signature_checking)) |
1990 | - self.assertEqual(config.SIGN_WHEN_REQUIRED, |
1991 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
1992 | - my_config.signing_policy)) |
1993 | - self.assertEqual(False, self.applyDeprecated(deprecated_in((2, 5, 0)), |
1994 | - my_config.signature_needed)) |
1995 | - |
1996 | - def test_signatures_ignore(self): |
1997 | - my_config = config.GlobalConfig.from_string(sample_ignore_signatures) |
1998 | - self.assertEqual(config.CHECK_ALWAYS, |
1999 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2000 | - my_config.signature_checking)) |
2001 | - self.assertEqual(config.SIGN_NEVER, |
2002 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2003 | - my_config.signing_policy)) |
2004 | - self.assertEqual(False, self.applyDeprecated(deprecated_in((2, 5, 0)), |
2005 | - my_config.signature_needed)) |
2006 | - |
2007 | - def _get_sample_config(self): |
2008 | - my_config = config.GlobalConfig.from_string(sample_config_text) |
2009 | - return my_config |
2010 | - |
2011 | - def test_gpg_signing_command(self): |
2012 | - my_config = self._get_sample_config() |
2013 | - self.assertEqual("gnome-gpg", |
2014 | - self.applyDeprecated( |
2015 | - deprecated_in((2, 5, 0)), my_config.gpg_signing_command)) |
2016 | - self.assertEqual(False, self.applyDeprecated(deprecated_in((2, 5, 0)), |
2017 | - my_config.signature_needed)) |
2018 | - |
2019 | - def test_gpg_signing_key(self): |
2020 | - my_config = self._get_sample_config() |
2021 | - self.assertEqual("DD4D5088", |
2022 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2023 | - my_config.gpg_signing_key)) |
2024 | - |
2025 | - def _get_empty_config(self): |
2026 | - my_config = config.GlobalConfig() |
2027 | - return my_config |
2028 | - |
2029 | - def test_gpg_signing_command_unset(self): |
2030 | - my_config = self._get_empty_config() |
2031 | - self.assertEqual("gpg", |
2032 | - self.applyDeprecated( |
2033 | - deprecated_in((2, 5, 0)), my_config.gpg_signing_command)) |
2034 | - |
2035 | def test_get_user_option_default(self): |
2036 | my_config = self._get_empty_config() |
2037 | self.assertEqual(None, my_config.get_user_option('no_option')) |
2038 | @@ -1261,24 +1115,6 @@ |
2039 | self.assertEqual("something", |
2040 | my_config.get_user_option('user_global_option')) |
2041 | |
2042 | - def test_post_commit_default(self): |
2043 | - my_config = self._get_sample_config() |
2044 | - self.assertEqual(None, |
2045 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2046 | - my_config.post_commit)) |
2047 | - |
2048 | - def test_configured_logformat(self): |
2049 | - my_config = self._get_sample_config() |
2050 | - self.assertEqual("short", |
2051 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2052 | - my_config.log_format)) |
2053 | - |
2054 | - def test_configured_acceptable_keys(self): |
2055 | - my_config = self._get_sample_config() |
2056 | - self.assertEqual("amy", |
2057 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2058 | - my_config.acceptable_keys)) |
2059 | - |
2060 | def test_configured_validate_signatures_in_log(self): |
2061 | my_config = self._get_sample_config() |
2062 | self.assertEqual(True, my_config.validate_signatures_in_log()) |
2063 | @@ -1517,57 +1353,6 @@ |
2064 | self.assertEqual('Robert Collins <robertc@example.org>', |
2065 | self.my_config.username()) |
2066 | |
2067 | - def test_signatures_not_set(self): |
2068 | - self.get_branch_config('http://www.example.com', |
2069 | - global_config=sample_ignore_signatures) |
2070 | - self.assertEqual(config.CHECK_ALWAYS, |
2071 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2072 | - self.my_config.signature_checking)) |
2073 | - self.assertEqual(config.SIGN_NEVER, |
2074 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2075 | - self.my_config.signing_policy)) |
2076 | - |
2077 | - def test_signatures_never(self): |
2078 | - self.get_branch_config('/a/c') |
2079 | - self.assertEqual(config.CHECK_NEVER, |
2080 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2081 | - self.my_config.signature_checking)) |
2082 | - |
2083 | - def test_signatures_when_available(self): |
2084 | - self.get_branch_config('/a/', global_config=sample_ignore_signatures) |
2085 | - self.assertEqual(config.CHECK_IF_POSSIBLE, |
2086 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2087 | - self.my_config.signature_checking)) |
2088 | - |
2089 | - def test_signatures_always(self): |
2090 | - self.get_branch_config('/b') |
2091 | - self.assertEqual(config.CHECK_ALWAYS, |
2092 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2093 | - self.my_config.signature_checking)) |
2094 | - |
2095 | - def test_gpg_signing_command(self): |
2096 | - self.get_branch_config('/b') |
2097 | - self.assertEqual("gnome-gpg", |
2098 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2099 | - self.my_config.gpg_signing_command)) |
2100 | - |
2101 | - def test_gpg_signing_command_missing(self): |
2102 | - self.get_branch_config('/a') |
2103 | - self.assertEqual("false", |
2104 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2105 | - self.my_config.gpg_signing_command)) |
2106 | - |
2107 | - def test_gpg_signing_key(self): |
2108 | - self.get_branch_config('/b') |
2109 | - self.assertEqual("DD4D5088", self.applyDeprecated(deprecated_in((2, 5, 0)), |
2110 | - self.my_config.gpg_signing_key)) |
2111 | - |
2112 | - def test_gpg_signing_key_default(self): |
2113 | - self.get_branch_config('/a') |
2114 | - self.assertEqual("erik@bagfors.nu", |
2115 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2116 | - self.my_config.gpg_signing_key)) |
2117 | - |
2118 | def test_get_user_option_global(self): |
2119 | self.get_branch_config('/a') |
2120 | self.assertEqual('something', |
2121 | @@ -1637,32 +1422,6 @@ |
2122 | 'http://www.example.com', 'norecurse_option'), |
2123 | config.POLICY_NONE) |
2124 | |
2125 | - def test_set_user_option_recurse_false_section(self): |
2126 | - # The following section has recurse=False set. The test is to |
2127 | - # make sure that a normal option can be added to the section, |
2128 | - # converting recurse=False to the norecurse policy. |
2129 | - self.get_branch_config('http://www.example.com/norecurse') |
2130 | - self.callDeprecated(['The recurse option is deprecated as of 0.14. ' |
2131 | - 'The section "http://www.example.com/norecurse" ' |
2132 | - 'has been converted to use policies.'], |
2133 | - self.my_config.set_user_option, |
2134 | - 'foo', 'bar', store=config.STORE_LOCATION) |
2135 | - self.assertEqual( |
2136 | - self.my_location_config._get_option_policy( |
2137 | - 'http://www.example.com/norecurse', 'foo'), |
2138 | - config.POLICY_NONE) |
2139 | - # The previously existing option is still norecurse: |
2140 | - self.assertEqual( |
2141 | - self.my_location_config._get_option_policy( |
2142 | - 'http://www.example.com/norecurse', 'normal_option'), |
2143 | - config.POLICY_NORECURSE) |
2144 | - |
2145 | - def test_post_commit_default(self): |
2146 | - self.get_branch_config('/a/c') |
2147 | - self.assertEqual('breezy.tests.test_config.post_commit', |
2148 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2149 | - self.my_config.post_commit)) |
2150 | - |
2151 | def get_branch_config(self, location, global_config=None, |
2152 | location_config=None): |
2153 | my_branch = FakeBranch(location) |
2154 | @@ -1678,33 +1437,6 @@ |
2155 | self.my_config = my_config |
2156 | self.my_location_config = my_config._get_location_config() |
2157 | |
2158 | - def test_set_user_setting_sets_and_saves(self): |
2159 | - self.get_branch_config('/a/c') |
2160 | - record = InstrumentedConfigObj("foo") |
2161 | - self.my_location_config._parser = record |
2162 | - |
2163 | - self.callDeprecated(['The recurse option is deprecated as of ' |
2164 | - '0.14. The section "/a/c" has been ' |
2165 | - 'converted to use policies.'], |
2166 | - self.my_config.set_user_option, |
2167 | - 'foo', 'bar', store=config.STORE_LOCATION) |
2168 | - self.assertEqual([('reload',), |
2169 | - ('__contains__', '/a/c'), |
2170 | - ('__contains__', '/a/c/'), |
2171 | - ('__setitem__', '/a/c', {}), |
2172 | - ('__getitem__', '/a/c'), |
2173 | - ('__setitem__', 'foo', 'bar'), |
2174 | - ('__getitem__', '/a/c'), |
2175 | - ('as_bool', 'recurse'), |
2176 | - ('__getitem__', '/a/c'), |
2177 | - ('__delitem__', 'recurse'), |
2178 | - ('__getitem__', '/a/c'), |
2179 | - ('keys',), |
2180 | - ('__getitem__', '/a/c'), |
2181 | - ('__contains__', 'foo:policy'), |
2182 | - ('write',)], |
2183 | - record._calls[1:]) |
2184 | - |
2185 | def test_set_user_setting_sets_and_saves2(self): |
2186 | self.get_branch_config('/a/c') |
2187 | self.assertIs(self.my_config.get_user_option('foo'), None) |
2188 | @@ -1771,64 +1503,11 @@ |
2189 | self.assertEqual("Robert Collins <robertc@example.org>", |
2190 | my_config.username()) |
2191 | |
2192 | - def test_signatures_forced(self): |
2193 | - my_config = self.get_branch_config( |
2194 | - global_config=sample_always_signatures) |
2195 | - self.assertEqual(config.CHECK_NEVER, |
2196 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2197 | - my_config.signature_checking)) |
2198 | - self.assertEqual(config.SIGN_ALWAYS, |
2199 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2200 | - my_config.signing_policy)) |
2201 | - self.assertTrue(self.applyDeprecated(deprecated_in((2, 5, 0)), |
2202 | - my_config.signature_needed)) |
2203 | - |
2204 | - def test_signatures_forced_branch(self): |
2205 | - my_config = self.get_branch_config( |
2206 | - global_config=sample_ignore_signatures, |
2207 | - branch_data_config=sample_always_signatures) |
2208 | - self.assertEqual(config.CHECK_NEVER, |
2209 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2210 | - my_config.signature_checking)) |
2211 | - self.assertEqual(config.SIGN_ALWAYS, |
2212 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2213 | - my_config.signing_policy)) |
2214 | - self.assertTrue(self.applyDeprecated(deprecated_in((2, 5, 0)), |
2215 | - my_config.signature_needed)) |
2216 | - |
2217 | - def test_gpg_signing_command(self): |
2218 | - my_config = self.get_branch_config( |
2219 | - global_config=sample_config_text, |
2220 | - # branch data cannot set gpg_signing_command |
2221 | - branch_data_config="gpg_signing_command=pgp") |
2222 | - self.assertEqual('gnome-gpg', |
2223 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2224 | - my_config.gpg_signing_command)) |
2225 | - |
2226 | def test_get_user_option_global(self): |
2227 | my_config = self.get_branch_config(global_config=sample_config_text) |
2228 | self.assertEqual('something', |
2229 | my_config.get_user_option('user_global_option')) |
2230 | |
2231 | - def test_post_commit_default(self): |
2232 | - my_config = self.get_branch_config(global_config=sample_config_text, |
2233 | - location='/a/c', |
2234 | - location_config=sample_branches_text) |
2235 | - self.assertEqual(my_config.branch.base, '/a/c') |
2236 | - self.assertEqual('breezy.tests.test_config.post_commit', |
2237 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2238 | - my_config.post_commit)) |
2239 | - my_config.set_user_option('post_commit', 'rmtree_root') |
2240 | - # post-commit is ignored when present in branch data |
2241 | - self.assertEqual('breezy.tests.test_config.post_commit', |
2242 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2243 | - my_config.post_commit)) |
2244 | - my_config.set_user_option('post_commit', 'rmtree_root', |
2245 | - store=config.STORE_LOCATION) |
2246 | - self.assertEqual('rmtree_root', |
2247 | - self.applyDeprecated(deprecated_in((2, 5, 0)), |
2248 | - my_config.post_commit)) |
2249 | - |
2250 | def test_config_precedence(self): |
2251 | # FIXME: eager test, luckily no persitent config file makes it fail |
2252 | # -- vila 20100716 |
2253 | |
2254 | === modified file 'breezy/tests/test_hooks.py' |
2255 | --- breezy/tests/test_hooks.py 2017-05-22 00:56:52 +0000 |
2256 | +++ breezy/tests/test_hooks.py 2017-05-30 21:16:02 +0000 |
2257 | @@ -30,9 +30,6 @@ |
2258 | known_hooks, |
2259 | known_hooks_key_to_object, |
2260 | ) |
2261 | -from ..symbol_versioning import ( |
2262 | - deprecated_in, |
2263 | - ) |
2264 | |
2265 | |
2266 | class TestHooks(tests.TestCase): |
2267 | |
2268 | === modified file 'breezy/tests/test_lru_cache.py' |
2269 | --- breezy/tests/test_lru_cache.py 2017-05-22 00:56:52 +0000 |
2270 | +++ breezy/tests/test_lru_cache.py 2017-05-30 21:16:02 +0000 |
2271 | @@ -18,7 +18,6 @@ |
2272 | |
2273 | from .. import ( |
2274 | lru_cache, |
2275 | - symbol_versioning, |
2276 | tests, |
2277 | ) |
2278 | |
2279 | @@ -128,13 +127,6 @@ |
2280 | |
2281 | self.assertFalse('foo' in cache) |
2282 | |
2283 | - def test_cleanup_function_deprecated(self): |
2284 | - """Test that per-node cleanup functions are no longer allowed""" |
2285 | - cache = lru_cache.LRUCache() |
2286 | - self.assertRaises(ValueError, self.applyDeprecated, |
2287 | - symbol_versioning.deprecated_in((2, 5, 0)), |
2288 | - cache.add, "key", 1, cleanup=lambda: None) |
2289 | - |
2290 | def test_len(self): |
2291 | cache = lru_cache.LRUCache(max_cache=10, after_cleanup_count=10) |
2292 | |
2293 | |
2294 | === modified file 'breezy/tests/test_osutils.py' |
2295 | --- breezy/tests/test_osutils.py 2017-05-24 22:42:07 +0000 |
2296 | +++ breezy/tests/test_osutils.py 2017-05-30 21:16:02 +0000 |
2297 | @@ -829,17 +829,12 @@ |
2298 | self.assertEqual('foobar', osutils.safe_revision_id('foobar')) |
2299 | |
2300 | def test_from_unicode_string_ascii_contents(self): |
2301 | - self.assertEqual('bargam', |
2302 | - osutils.safe_revision_id(u'bargam', warn=False)) |
2303 | - |
2304 | - def test_from_unicode_deprecated(self): |
2305 | - self.assertEqual('bargam', |
2306 | - self.callDeprecated([osutils._revision_id_warning], |
2307 | - osutils.safe_revision_id, u'bargam')) |
2308 | + self.assertRaises(TypeError, |
2309 | + osutils.safe_revision_id, u'bargam') |
2310 | |
2311 | def test_from_unicode_string_unicode_contents(self): |
2312 | - self.assertEqual('bargam\xc2\xae', |
2313 | - osutils.safe_revision_id(u'bargam\xae', warn=False)) |
2314 | + self.assertRaises(TypeError, |
2315 | + osutils.safe_revision_id, u'bargam\xae') |
2316 | |
2317 | def test_from_utf8_string(self): |
2318 | self.assertEqual('foo\xc2\xae', |
2319 | @@ -856,16 +851,11 @@ |
2320 | self.assertEqual('foobar', osutils.safe_file_id('foobar')) |
2321 | |
2322 | def test_from_unicode_string_ascii_contents(self): |
2323 | - self.assertEqual('bargam', osutils.safe_file_id(u'bargam', warn=False)) |
2324 | - |
2325 | - def test_from_unicode_deprecated(self): |
2326 | - self.assertEqual('bargam', |
2327 | - self.callDeprecated([osutils._file_id_warning], |
2328 | - osutils.safe_file_id, u'bargam')) |
2329 | + self.assertRaises(TypeError, osutils.safe_file_id, u'bargam') |
2330 | |
2331 | def test_from_unicode_string_unicode_contents(self): |
2332 | - self.assertEqual('bargam\xc2\xae', |
2333 | - osutils.safe_file_id(u'bargam\xae', warn=False)) |
2334 | + self.assertRaises(TypeError, |
2335 | + osutils.safe_file_id, u'bargam\xae') |
2336 | |
2337 | def test_from_utf8_string(self): |
2338 | self.assertEqual('foo\xc2\xae', |
2339 | @@ -1831,32 +1821,6 @@ |
2340 | self.assertRaises(IOError, osutils.resource_string, 'breezy', 'yyy.xx') |
2341 | |
2342 | |
2343 | -class TestReCompile(tests.TestCase): |
2344 | - |
2345 | - def _deprecated_re_compile_checked(self, *args, **kwargs): |
2346 | - return self.applyDeprecated(symbol_versioning.deprecated_in((2, 2, 0)), |
2347 | - osutils.re_compile_checked, *args, **kwargs) |
2348 | - |
2349 | - def test_re_compile_checked(self): |
2350 | - r = self._deprecated_re_compile_checked(r'A*', re.IGNORECASE) |
2351 | - self.assertTrue(r.match('aaaa')) |
2352 | - self.assertTrue(r.match('aAaA')) |
2353 | - |
2354 | - def test_re_compile_checked_error(self): |
2355 | - # like https://bugs.launchpad.net/bzr/+bug/251352 |
2356 | - |
2357 | - # Due to possible test isolation error, re.compile is not lazy at |
2358 | - # this point. We re-install lazy compile. |
2359 | - lazy_regex.install_lazy_compile() |
2360 | - err = self.assertRaises( |
2361 | - errors.BzrCommandError, |
2362 | - self._deprecated_re_compile_checked, '*', re.IGNORECASE, 'test case') |
2363 | - self.assertEqual( |
2364 | - 'Invalid regular expression in test case: ' |
2365 | - '"*" nothing to repeat', |
2366 | - str(err)) |
2367 | - |
2368 | - |
2369 | class TestDirReader(tests.TestCaseInTempDir): |
2370 | |
2371 | scenarios = dir_reader_scenarios() |
2372 | |
2373 | === modified file 'breezy/tests/test_remote.py' |
2374 | --- breezy/tests/test_remote.py 2017-05-22 00:56:52 +0000 |
2375 | +++ breezy/tests/test_remote.py 2017-05-30 21:16:02 +0000 |
2376 | @@ -73,7 +73,6 @@ |
2377 | SmartServerRepositoryGetStream_1_19, |
2378 | _stream_to_byte_stream, |
2379 | ) |
2380 | -from ..symbol_versioning import deprecated_in |
2381 | from . import ( |
2382 | test_server, |
2383 | ) |
2384 | |
2385 | === modified file 'breezy/tests/test_repository.py' |
2386 | --- breezy/tests/test_repository.py 2017-05-25 01:35:55 +0000 |
2387 | +++ breezy/tests/test_repository.py 2017-05-30 21:16:02 +0000 |
2388 | @@ -31,7 +31,6 @@ |
2389 | ) |
2390 | from breezy import ( |
2391 | btree_index, |
2392 | - symbol_versioning, |
2393 | tests, |
2394 | transport, |
2395 | vf_search, |
2396 | |
2397 | === modified file 'breezy/tests/test_revisionspec.py' |
2398 | --- breezy/tests/test_revisionspec.py 2017-05-22 00:56:52 +0000 |
2399 | +++ breezy/tests/test_revisionspec.py 2017-05-30 21:16:02 +0000 |
2400 | @@ -20,7 +20,6 @@ |
2401 | from breezy import ( |
2402 | errors, |
2403 | revision as _mod_revision, |
2404 | - symbol_versioning, |
2405 | ) |
2406 | from breezy.tests import TestCaseWithTransport |
2407 | from breezy.revisionspec import ( |
2408 | @@ -115,18 +114,6 @@ |
2409 | |
2410 | class TestRevisionSpecBase(TestRevisionSpec): |
2411 | |
2412 | - def test_wants_revision_history(self): |
2413 | - # If wants_revision_history = True, then _match_on should get the |
2414 | - # branch revision history |
2415 | - spec = RevisionSpecMatchOnTrap('foo', _internal=True) |
2416 | - spec.wants_revision_history = True |
2417 | - self.callDeprecated(['RevisionSpec.wants_revision_history was ' |
2418 | - 'deprecated in 2.5 (RevisionSpecMatchOnTrap).'], |
2419 | - spec.in_history, self.tree.branch) |
2420 | - |
2421 | - self.assertEqual((self.tree.branch, ['r1' ,'r2']), |
2422 | - spec.last_call) |
2423 | - |
2424 | def test_wants_no_revision_history(self): |
2425 | # If wants_revision_history = False, then _match_on should get None for |
2426 | # the branch revision history |
2427 | |
2428 | === modified file 'breezy/tests/test_selftest.py' |
2429 | --- breezy/tests/test_selftest.py 2017-05-23 14:08:03 +0000 |
2430 | +++ breezy/tests/test_selftest.py 2017-05-30 21:16:02 +0000 |
2431 | @@ -539,19 +539,6 @@ |
2432 | self.assertRaises(AssertionError, self.assertEqualStat, |
2433 | os.lstat("foo"), os.lstat("longname")) |
2434 | |
2435 | - def test_failUnlessExists(self): |
2436 | - """Deprecated failUnlessExists and failIfExists""" |
2437 | - self.applyDeprecated( |
2438 | - deprecated_in((2, 4)), |
2439 | - self.failUnlessExists, '.') |
2440 | - self.build_tree(['foo/', 'foo/bar']) |
2441 | - self.applyDeprecated( |
2442 | - deprecated_in((2, 4)), |
2443 | - self.failUnlessExists, 'foo/bar') |
2444 | - self.applyDeprecated( |
2445 | - deprecated_in((2, 4)), |
2446 | - self.failIfExists, 'foo/foo') |
2447 | - |
2448 | def test_assertPathExists(self): |
2449 | self.assertPathExists('.') |
2450 | self.build_tree(['foo/', 'foo/bar']) |
2451 | |
2452 | === modified file 'breezy/tests/test_smart_add.py' |
2453 | --- breezy/tests/test_smart_add.py 2017-05-22 00:56:52 +0000 |
2454 | +++ breezy/tests/test_smart_add.py 2017-05-30 21:16:02 +0000 |
2455 | @@ -16,6 +16,7 @@ |
2456 | |
2457 | from .. import ( |
2458 | add, |
2459 | + cache_utf8, |
2460 | inventory, |
2461 | osutils, |
2462 | tests, |
2463 | @@ -30,9 +31,7 @@ |
2464 | def __call__(self, inv, parent_ie, path, kind): |
2465 | # The first part just logs if appropriate |
2466 | # Now generate a custom id |
2467 | - file_id = osutils.safe_file_id(kind + '-' |
2468 | - + path.replace('/', '%'), |
2469 | - warn=False) |
2470 | + file_id = cache_utf8.encode(kind + '-' + path.replace('/', '%')) |
2471 | if self.should_print: |
2472 | self._to_file.write('added %s with id %s\n' |
2473 | % (path, file_id)) |
2474 | |
2475 | === modified file 'breezy/tests/test_transform.py' |
2476 | --- breezy/tests/test_transform.py 2017-05-22 00:56:52 +0000 |
2477 | +++ breezy/tests/test_transform.py 2017-05-30 21:16:02 +0000 |
2478 | @@ -27,7 +27,6 @@ |
2479 | osutils, |
2480 | revision as _mod_revision, |
2481 | rules, |
2482 | - symbol_versioning, |
2483 | tests, |
2484 | trace, |
2485 | transform, |
2486 | |
2487 | === modified file 'breezy/transform.py' |
2488 | --- breezy/transform.py 2017-05-25 01:35:55 +0000 |
2489 | +++ breezy/transform.py 2017-05-30 21:16:02 +0000 |
2490 | @@ -61,11 +61,6 @@ |
2491 | splitpath, |
2492 | ) |
2493 | from .progress import ProgressPhase |
2494 | -from .symbol_versioning import ( |
2495 | - deprecated_function, |
2496 | - deprecated_in, |
2497 | - deprecated_method, |
2498 | - ) |
2499 | |
2500 | |
2501 | ROOT_PARENT = "root-parent" |
2502 | @@ -2051,12 +2046,6 @@ |
2503 | pass |
2504 | |
2505 | @property |
2506 | - @deprecated_method(deprecated_in((2, 5, 0))) |
2507 | - def inventory(self): |
2508 | - """This Tree does not use inventory as its backing data.""" |
2509 | - raise NotImplementedError(_PreviewTree.inventory) |
2510 | - |
2511 | - @property |
2512 | def root_inventory(self): |
2513 | """This Tree does not use inventory as its backing data.""" |
2514 | raise NotImplementedError(_PreviewTree.root_inventory) |
2515 | |
2516 | === modified file 'breezy/transport/__init__.py' |
2517 | --- breezy/transport/__init__.py 2017-05-25 01:35:55 +0000 |
2518 | +++ breezy/transport/__init__.py 2017-05-30 21:16:02 +0000 |
2519 | @@ -38,7 +38,6 @@ |
2520 | from breezy import ( |
2521 | errors, |
2522 | osutils, |
2523 | - symbol_versioning, |
2524 | ui, |
2525 | urlutils, |
2526 | ) |
2527 | @@ -48,9 +47,6 @@ |
2528 | BytesIO, |
2529 | string_types, |
2530 | ) |
2531 | -from ..symbol_versioning import ( |
2532 | - DEPRECATED_PARAMETER, |
2533 | - ) |
2534 | from ..trace import ( |
2535 | mutter, |
2536 | ) |
2537 | @@ -922,15 +918,7 @@ |
2538 | None means just use the default. |
2539 | :return: The length of the file that was written. |
2540 | """ |
2541 | - # We would like to mark this as NotImplemented, but most likely |
2542 | - # transports have defined it in terms of the old api. |
2543 | - symbol_versioning.warn('Transport %s should implement put_file,' |
2544 | - ' rather than implementing put() as of' |
2545 | - ' version 0.11.' |
2546 | - % (self.__class__.__name__,), |
2547 | - DeprecationWarning) |
2548 | - return self.put(relpath, f, mode=mode) |
2549 | - #raise NotImplementedError(self.put_file) |
2550 | + raise NotImplementedError(self.put_file) |
2551 | |
2552 | def put_file_non_atomic(self, relpath, f, mode=None, |
2553 | create_parent_dir=False, |
2554 | @@ -1001,12 +989,7 @@ |
2555 | |
2556 | :returns: the length of relpath before the content was written to it. |
2557 | """ |
2558 | - symbol_versioning.warn('Transport %s should implement append_file,' |
2559 | - ' rather than implementing append() as of' |
2560 | - ' version 0.11.' |
2561 | - % (self.__class__.__name__,), |
2562 | - DeprecationWarning) |
2563 | - return self.append(relpath, f, mode=mode) |
2564 | + raise NotImplementedError(self.append_file) |
2565 | |
2566 | def append_bytes(self, relpath, bytes, mode=None): |
2567 | """Append bytes to a file at relpath. |
2568 | |
2569 | === modified file 'breezy/transport/ftp/__init__.py' |
2570 | --- breezy/transport/ftp/__init__.py 2017-05-22 00:56:52 +0000 |
2571 | +++ breezy/transport/ftp/__init__.py 2017-05-30 21:16:02 +0000 |
2572 | @@ -44,12 +44,6 @@ |
2573 | from ...sixish import ( |
2574 | BytesIO, |
2575 | ) |
2576 | -from ...symbol_versioning import ( |
2577 | - DEPRECATED_PARAMETER, |
2578 | - deprecated_in, |
2579 | - deprecated_passed, |
2580 | - warn, |
2581 | - ) |
2582 | from ...trace import mutter, warning |
2583 | from ...transport import ( |
2584 | AppendBasedFileStream, |
2585 | |
2586 | === modified file 'breezy/transport/gio_transport.py' |
2587 | --- breezy/transport/gio_transport.py 2017-05-22 00:56:52 +0000 |
2588 | +++ breezy/transport/gio_transport.py 2017-05-30 21:16:02 +0000 |
2589 | @@ -43,12 +43,6 @@ |
2590 | from ..sixish import ( |
2591 | BytesIO, |
2592 | ) |
2593 | -from ..symbol_versioning import ( |
2594 | - DEPRECATED_PARAMETER, |
2595 | - deprecated_in, |
2596 | - deprecated_passed, |
2597 | - warn, |
2598 | - ) |
2599 | from ..trace import mutter |
2600 | from . import ( |
2601 | FileStream, |
2602 | |
2603 | === modified file 'breezy/transport/local.py' |
2604 | --- breezy/transport/local.py 2017-05-22 00:56:52 +0000 |
2605 | +++ breezy/transport/local.py 2017-05-30 21:16:02 +0000 |
2606 | @@ -34,7 +34,6 @@ |
2607 | atomicfile, |
2608 | osutils, |
2609 | urlutils, |
2610 | - symbol_versioning, |
2611 | ) |
2612 | from breezy.transport import LateReadError |
2613 | """) |
2614 | |
2615 | === modified file 'breezy/tree.py' |
2616 | --- breezy/tree.py 2017-05-25 01:35:55 +0000 |
2617 | +++ breezy/tree.py 2017-05-30 21:16:02 +0000 |
2618 | @@ -42,10 +42,6 @@ |
2619 | |
2620 | from .decorators import needs_read_lock |
2621 | from .inter import InterObject |
2622 | -from .symbol_versioning import ( |
2623 | - deprecated_in, |
2624 | - deprecated_method, |
2625 | - ) |
2626 | |
2627 | |
2628 | class Tree(object): |
2629 | @@ -138,10 +134,6 @@ |
2630 | def has_id(self, file_id): |
2631 | raise NotImplementedError(self.has_id) |
2632 | |
2633 | - @deprecated_method(deprecated_in((2, 4, 0))) |
2634 | - def __contains__(self, file_id): |
2635 | - return self.has_id(file_id) |
2636 | - |
2637 | def has_or_had_id(self, file_id): |
2638 | raise NotImplementedError(self.has_or_had_id) |
2639 | |
2640 | @@ -781,13 +773,6 @@ |
2641 | yield cur_path |
2642 | # all done. |
2643 | |
2644 | - @deprecated_method(deprecated_in((2, 5, 0))) |
2645 | - def _get_inventory(self): |
2646 | - return self._inventory |
2647 | - |
2648 | - inventory = property(_get_inventory, |
2649 | - doc="Inventory of this Tree") |
2650 | - |
2651 | def _get_root_inventory(self): |
2652 | return self._inventory |
2653 | |
2654 | @@ -839,10 +824,6 @@ |
2655 | def all_file_ids(self): |
2656 | return {entry.file_id for path, entry in self.iter_entries_by_dir()} |
2657 | |
2658 | - @deprecated_method(deprecated_in((2, 4, 0))) |
2659 | - def __iter__(self): |
2660 | - return iter(self.all_file_ids()) |
2661 | - |
2662 | def filter_unversioned_files(self, paths): |
2663 | """Filter out paths that are versioned. |
2664 | |
2665 | @@ -885,10 +866,6 @@ |
2666 | inv, inv_file_id = self._unpack_file_id(file_id) |
2667 | return inv[inv_file_id].children.itervalues() |
2668 | |
2669 | - @deprecated_method(deprecated_in((2, 5, 0))) |
2670 | - def get_file_by_path(self, path): |
2671 | - return self.get_file(self.path2id(path), path) |
2672 | - |
2673 | def iter_children(self, file_id, path=None): |
2674 | """See Tree.iter_children.""" |
2675 | entry = self.iter_entries_by_dir([file_id]).next()[1] |
2676 | |
2677 | === modified file 'breezy/vf_repository.py' |
2678 | --- breezy/vf_repository.py 2017-05-25 01:35:55 +0000 |
2679 | +++ breezy/vf_repository.py 2017-05-30 21:16:02 +0000 |
2680 | @@ -37,7 +37,6 @@ |
2681 | revision as _mod_revision, |
2682 | serializer as _mod_serializer, |
2683 | static_tuple, |
2684 | - symbol_versioning, |
2685 | tsort, |
2686 | ui, |
2687 | versionedfile, |
2688 | @@ -2643,13 +2642,10 @@ |
2689 | |
2690 | @needs_read_lock |
2691 | def search_missing_revision_ids(self, |
2692 | - revision_id=symbol_versioning.DEPRECATED_PARAMETER, |
2693 | find_ghosts=True, revision_ids=None, if_present_ids=None, |
2694 | limit=None): |
2695 | """Return the revision ids that source has that target does not. |
2696 | |
2697 | - :param revision_id: only return revision ids included by this |
2698 | - revision_id. |
2699 | :param revision_ids: return revision ids included by these |
2700 | revision_ids. NoSuchRevision will be raised if any of these |
2701 | revisions are not present. |
2702 | @@ -2661,17 +2657,6 @@ |
2703 | rather than just finding the surface difference. |
2704 | :return: A breezy.graph.SearchResult. |
2705 | """ |
2706 | - if symbol_versioning.deprecated_passed(revision_id): |
2707 | - symbol_versioning.warn( |
2708 | - 'search_missing_revision_ids(revision_id=...) was ' |
2709 | - 'deprecated in 2.4. Use revision_ids=[...] instead.', |
2710 | - DeprecationWarning, stacklevel=2) |
2711 | - if revision_ids is not None: |
2712 | - raise AssertionError( |
2713 | - 'revision_ids is mutually exclusive with revision_id') |
2714 | - if revision_id is not None: |
2715 | - revision_ids = [revision_id] |
2716 | - del revision_id |
2717 | # stop searching at found target revisions. |
2718 | if not find_ghosts and (revision_ids is not None or if_present_ids is |
2719 | not None): |
2720 | |
2721 | === modified file 'breezy/weave.py' |
2722 | --- breezy/weave.py 2017-05-24 19:44:00 +0000 |
2723 | +++ breezy/weave.py 2017-05-30 21:16:02 +0000 |
2724 | @@ -88,7 +88,6 @@ |
2725 | from .sixish import ( |
2726 | BytesIO, |
2727 | ) |
2728 | -from .symbol_versioning import * |
2729 | from .trace import mutter |
2730 | from .versionedfile import ( |
2731 | AbsentContentFactory, |
2732 | |
2733 | === modified file 'breezy/workingtree.py' |
2734 | --- breezy/workingtree.py 2017-05-25 01:35:55 +0000 |
2735 | +++ breezy/workingtree.py 2017-05-30 21:16:02 +0000 |
2736 | @@ -48,6 +48,7 @@ |
2737 | |
2738 | from breezy import ( |
2739 | branch, |
2740 | + cache_utf8, |
2741 | conflicts as _mod_conflicts, |
2742 | controldir, |
2743 | errors, |
2744 | @@ -76,7 +77,6 @@ |
2745 | from . import ( |
2746 | bzrdir, |
2747 | osutils, |
2748 | - symbol_versioning, |
2749 | ) |
2750 | from .decorators import needs_read_lock, needs_write_lock |
2751 | from .i18n import gettext |
2752 | @@ -97,10 +97,6 @@ |
2753 | BytesIO, |
2754 | ) |
2755 | from .trace import mutter, note |
2756 | -from .symbol_versioning import ( |
2757 | - deprecated_passed, |
2758 | - DEPRECATED_PARAMETER, |
2759 | - ) |
2760 | |
2761 | |
2762 | MERGE_MODIFIED_HEADER_1 = "BZR merge-modified list format 1" |
2763 | @@ -180,7 +176,7 @@ |
2764 | return views.DisabledViews(self) |
2765 | |
2766 | def __init__(self, basedir='.', |
2767 | - branch=DEPRECATED_PARAMETER, |
2768 | + branch=None, |
2769 | _internal=False, |
2770 | _transport=None, |
2771 | _format=None, |
2772 | @@ -196,7 +192,7 @@ |
2773 | "WorkingTree.open() to obtain a WorkingTree.") |
2774 | basedir = safe_unicode(basedir) |
2775 | mutter("opening working tree %r", basedir) |
2776 | - if deprecated_passed(branch): |
2777 | + if branch is not None: |
2778 | self._branch = branch |
2779 | else: |
2780 | self._branch = self.bzrdir.open_branch() |
2781 | @@ -1787,7 +1783,7 @@ |
2782 | """ |
2783 | |
2784 | def __init__(self, basedir='.', |
2785 | - branch=DEPRECATED_PARAMETER, |
2786 | + branch=None, |
2787 | _inventory=None, |
2788 | _control_files=None, |
2789 | _internal=False, |
2790 | @@ -2376,7 +2372,7 @@ |
2791 | raise errors.MergeModifiedFormatError() |
2792 | for s in _mod_rio.RioReader(hashfile): |
2793 | # RioReader reads in Unicode, so convert file_ids back to utf8 |
2794 | - file_id = osutils.safe_file_id(s.get("file_id"), warn=False) |
2795 | + file_id = cache_utf8.encode(s.get("file_id")) |
2796 | if not self.has_id(file_id): |
2797 | continue |
2798 | text_hash = s.get("hash") |
2799 | |
2800 | === modified file 'breezy/workingtree_4.py' |
2801 | --- breezy/workingtree_4.py 2017-05-25 01:35:55 +0000 |
2802 | +++ breezy/workingtree_4.py 2017-05-30 21:16:02 +0000 |
2803 | @@ -72,10 +72,6 @@ |
2804 | from .sixish import ( |
2805 | BytesIO, |
2806 | ) |
2807 | -from .symbol_versioning import ( |
2808 | - deprecated_in, |
2809 | - deprecated_method, |
2810 | - ) |
2811 | from .transport.local import LocalTransport |
2812 | from .tree import ( |
2813 | InterTree, |
2814 | @@ -433,13 +429,6 @@ |
2815 | self._generate_inventory() |
2816 | return self._inventory |
2817 | |
2818 | - @deprecated_method(deprecated_in((2, 5, 0))) |
2819 | - def _get_inventory(self): |
2820 | - return self.root_inventory |
2821 | - |
2822 | - inventory = property(_get_inventory, |
2823 | - doc="Inventory of this Tree") |
2824 | - |
2825 | root_inventory = property(_get_root_inventory, |
2826 | "Root inventory of this tree") |
2827 | |
2828 | @@ -1951,13 +1940,6 @@ |
2829 | root_inventory = property(_get_root_inventory, |
2830 | doc="Inventory of this Tree") |
2831 | |
2832 | - @deprecated_method(deprecated_in((2, 5, 0))) |
2833 | - def _get_inventory(self): |
2834 | - return self.root_inventory |
2835 | - |
2836 | - inventory = property(_get_inventory, |
2837 | - doc="Inventory of this Tree") |
2838 | - |
2839 | def get_parent_ids(self): |
2840 | """The parents of a tree in the dirstate are not cached.""" |
2841 | return self._repository.get_revision(self._revision_id).parent_ids |
2842 | |
2843 | === modified file 'doc/en/release-notes/brz-3.0.txt' |
2844 | --- doc/en/release-notes/brz-3.0.txt 2017-05-24 20:47:06 +0000 |
2845 | +++ doc/en/release-notes/brz-3.0.txt 2017-05-30 21:16:02 +0000 |
2846 | @@ -55,6 +55,9 @@ |
2847 | * Signature of ``load_tests`` used by ``TestLoader`` changed to be |
2848 | compatible with standard libarary unittest. (Martin Packman) |
2849 | |
2850 | + * All previously deprecated functionality has been removed. |
2851 | + (Jelmer Vernooij) |
2852 | + |
2853 | * Renamed ``breezy.delta.report_delta`` parameter ``filter=`` to |
2854 | ``predicate=``. (Martin Packman) |
2855 |
Approve per earlier review.