Merge lp:~jelmer/brz/deprecation into lp:brz

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
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
Martin Packman (gz) wrote :

Approve per earlier review.

review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
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
=== modified file 'breezy/atomicfile.py'
--- breezy/atomicfile.py 2017-05-22 00:56:52 +0000
+++ breezy/atomicfile.py 2017-05-30 21:16:02 +0000
@@ -26,7 +26,6 @@
26from breezy import (26from breezy import (
27 errors,27 errors,
28 osutils,28 osutils,
29 symbol_versioning,
30 )29 )
31""")30""")
3231
3332
=== modified file 'breezy/branch.py'
--- breezy/branch.py 2017-05-25 01:35:55 +0000
+++ breezy/branch.py 2017-05-30 21:16:02 +0000
@@ -67,10 +67,6 @@
67from .sixish import (67from .sixish import (
68 BytesIO,68 BytesIO,
69 )69 )
70from .symbol_versioning import (
71 deprecated_in,
72 deprecated_method,
73 )
74from .trace import mutter, mutter_callsite, note, is_quiet70from .trace import mutter, mutter_callsite, note, is_quiet
7571
7672
@@ -759,19 +755,6 @@
759 """755 """
760 return None756 return None
761757
762 @deprecated_method(deprecated_in((2, 5, 0)))
763 def get_revision_delta(self, revno):
764 """Return the delta for one revision.
765
766 The delta is relative to its mainline predecessor, or the
767 empty tree for revision 1.
768 """
769 try:
770 revid = self.get_rev_id(revno)
771 except errors.NoSuchRevision:
772 raise errors.InvalidRevisionNumber(revno)
773 return self.repository.get_revision_delta(revid)
774
775 def get_stacked_on_url(self):758 def get_stacked_on_url(self):
776 """Get the URL this branch is stacked against.759 """Get the URL this branch is stacked against.
777760
778761
=== modified file 'breezy/builtins.py'
--- breezy/builtins.py 2017-05-25 01:35:55 +0000
+++ breezy/builtins.py 2017-05-30 21:16:02 +0000
@@ -33,6 +33,7 @@
33 bugtracker,33 bugtracker,
34 bundle,34 bundle,
35 btree_index,35 btree_index,
36 cache_utf8,
36 controldir,37 controldir,
37 directory_service,38 directory_service,
38 delta,39 delta,
@@ -48,6 +49,7 @@
48 rename_map,49 rename_map,
49 revision as _mod_revision,50 revision as _mod_revision,
50 static_tuple,51 static_tuple,
52 symbol_versioning,
51 timestamp,53 timestamp,
52 transport,54 transport,
53 ui,55 ui,
@@ -81,9 +83,6 @@
81 text_type,83 text_type,
82)84)
83from .trace import mutter, note, warning, is_quiet, get_verbosity_level85from .trace import mutter, note, warning, is_quiet, get_verbosity_level
84from . import (
85 symbol_versioning,
86 )
8786
8887
89def _get_branch_location(control_dir, possible_transports=None):88def _get_branch_location(control_dir, possible_transports=None):
@@ -458,7 +457,7 @@
458 try:457 try:
459 # TODO: jam 20060112 should cat-revision always output utf-8?458 # TODO: jam 20060112 should cat-revision always output utf-8?
460 if revision_id is not None:459 if revision_id is not None:
461 revision_id = osutils.safe_revision_id(revision_id, warn=False)460 revision_id = cache_utf8.encode(revision_id)
462 try:461 try:
463 self.print_revision(revisions, revision_id)462 self.print_revision(revisions, revision_id)
464 except errors.NoSuchRevision:463 except errors.NoSuchRevision:
@@ -1444,7 +1443,6 @@
1444 use_existing_dir=False, switch=False, bind=False,1443 use_existing_dir=False, switch=False, bind=False,
1445 files_from=None):1444 files_from=None):
1446 from breezy import switch as _mod_switch1445 from breezy import switch as _mod_switch
1447 from .tag import _merge_tags_if_possible
1448 if self.invoked_as in ['get', 'clone']:1446 if self.invoked_as in ['get', 'clone']:
1449 ui.ui_factory.show_user_warning(1447 ui.ui_factory.show_user_warning(
1450 'deprecated_command',1448 'deprecated_command',
@@ -1523,7 +1521,8 @@
1523 to_repo = to_dir.create_repository()1521 to_repo = to_dir.create_repository()
1524 to_repo.fetch(br_from.repository, revision_id=revision_id)1522 to_repo.fetch(br_from.repository, revision_id=revision_id)
1525 branch = br_from.sprout(to_dir, revision_id=revision_id)1523 branch = br_from.sprout(to_dir, revision_id=revision_id)
1526 _merge_tags_if_possible(br_from, branch)1524 br_from.tags.merge_to(branch.tags)
1525
1527 # If the source branch is stacked, the new branch may1526 # If the source branch is stacked, the new branch may
1528 # be stacked whether we asked for that explicitly or not.1527 # be stacked whether we asked for that explicitly or not.
1529 # We therefore need a try/except here and not just 'if stacked:'1528 # We therefore need a try/except here and not just 'if stacked:'
@@ -2744,7 +2743,6 @@
2744 match_author=None,2743 match_author=None,
2745 match_bugs=None,2744 match_bugs=None,
2746 omit_merges=False,2745 omit_merges=False,
2747 include_merges=symbol_versioning.DEPRECATED_PARAMETER,
2748 ):2746 ):
2749 from .log import (2747 from .log import (
2750 Logger,2748 Logger,
@@ -2752,19 +2750,6 @@
2752 _get_info_for_log_files,2750 _get_info_for_log_files,
2753 )2751 )
2754 direction = (forward and 'forward') or 'reverse'2752 direction = (forward and 'forward') or 'reverse'
2755 if symbol_versioning.deprecated_passed(include_merges):
2756 ui.ui_factory.show_user_warning(
2757 'deprecated_command_option',
2758 deprecated_name='--include-merges',
2759 recommended_name='--include-merged',
2760 deprecated_in_version='2.5',
2761 command=self.invoked_as)
2762 if include_merged is None:
2763 include_merged = include_merges
2764 else:
2765 raise errors.BzrCommandError(gettext(
2766 '{0} and {1} are mutually exclusive').format(
2767 '--include-merges', '--include-merged'))
2768 if include_merged is None:2753 if include_merged is None:
2769 include_merged = False2754 include_merged = False
2770 if (exclude_common_ancestry2755 if (exclude_common_ancestry
@@ -4540,7 +4525,6 @@
4540 def _get_merger_from_branch(self, tree, location, revision, remember,4525 def _get_merger_from_branch(self, tree, location, revision, remember,
4541 possible_transports, pb):4526 possible_transports, pb):
4542 """Produce a merger from a location, assuming it refers to a branch."""4527 """Produce a merger from a location, assuming it refers to a branch."""
4543 from .tag import _merge_tags_if_possible
4544 # find the branch locations4528 # find the branch locations
4545 other_loc, user_location = self._select_branch_location(tree, location,4529 other_loc, user_location = self._select_branch_location(tree, location,
4546 revision, -1)4530 revision, -1)
@@ -4580,7 +4564,7 @@
4580 tree.branch.set_submit_branch(other_branch.base)4564 tree.branch.set_submit_branch(other_branch.base)
4581 # Merge tags (but don't set them in the master branch yet, the user4565 # Merge tags (but don't set them in the master branch yet, the user
4582 # might revert this merge). Commit will propagate them.4566 # might revert this merge). Commit will propagate them.
4583 _merge_tags_if_possible(other_branch, tree.branch, ignore_master=True)4567 other_branch.tags.merge_to(tree.branch.tags, ignore_master=True)
4584 merger = _mod_merge.Merger.from_revision_ids(pb, tree,4568 merger = _mod_merge.Merger.from_revision_ids(pb, tree,
4585 other_revision_id, base_revision_id, other_branch, base_branch)4569 other_revision_id, base_revision_id, other_branch, base_branch)
4586 if other_path != '':4570 if other_path != '':
@@ -4939,26 +4923,12 @@
4939 log_format=None, long=False, short=False, line=False,4923 log_format=None, long=False, short=False, line=False,
4940 show_ids=False, verbose=False, this=False, other=False,4924 show_ids=False, verbose=False, this=False, other=False,
4941 include_merged=None, revision=None, my_revision=None,4925 include_merged=None, revision=None, my_revision=None,
4942 directory=u'.',4926 directory=u'.'):
4943 include_merges=symbol_versioning.DEPRECATED_PARAMETER):
4944 from breezy.missing import find_unmerged, iter_log_revisions4927 from breezy.missing import find_unmerged, iter_log_revisions
4945 def message(s):4928 def message(s):
4946 if not is_quiet():4929 if not is_quiet():
4947 self.outf.write(s)4930 self.outf.write(s)
49484931
4949 if symbol_versioning.deprecated_passed(include_merges):
4950 ui.ui_factory.show_user_warning(
4951 'deprecated_command_option',
4952 deprecated_name='--include-merges',
4953 recommended_name='--include-merged',
4954 deprecated_in_version='2.5',
4955 command=self.invoked_as)
4956 if include_merged is None:
4957 include_merged = include_merges
4958 else:
4959 raise errors.BzrCommandError(gettext(
4960 '{0} and {1} are mutually exclusive').format(
4961 '--include-merges', '--include-merged'))
4962 if include_merged is None:4932 if include_merged is None:
4963 include_merged = False4933 include_merged = False
4964 if this:4934 if this:
49654935
=== modified file 'breezy/bundle/bundle_data.py'
--- breezy/bundle/bundle_data.py 2017-05-25 01:35:55 +0000
+++ breezy/bundle/bundle_data.py 2017-05-30 21:16:02 +0000
@@ -23,6 +23,7 @@
23import pprint23import pprint
2424
25from .. import (25from .. import (
26 cache_utf8,
26 osutils,27 osutils,
27 timestamp,28 timestamp,
28 )29 )
@@ -323,8 +324,7 @@
323 if last_changed is not None:324 if last_changed is not None:
324 # last_changed will be a Unicode string because of how it was325 # last_changed will be a Unicode string because of how it was
325 # read. Convert it back to utf8.326 # read. Convert it back to utf8.
326 changed_revision_id = osutils.safe_revision_id(last_changed,327 changed_revision_id = cache_utf8.encode(last_changed)
327 warn=False)
328 else:328 else:
329 changed_revision_id = revision_id329 changed_revision_id = revision_id
330 bundle_tree.note_last_changed(path, changed_revision_id)330 bundle_tree.note_last_changed(path, changed_revision_id)
@@ -399,7 +399,7 @@
399 ': %r' % extra)399 ': %r' % extra)
400 # This will be Unicode because of how the stream is read. Turn it400 # This will be Unicode because of how the stream is read. Turn it
401 # back into a utf8 file_id401 # back into a utf8 file_id
402 file_id = osutils.safe_file_id(info[1][8:], warn=False)402 file_id = cache_utf8.encode(info[1][8:])
403403
404 bundle_tree.note_id(file_id, path, kind)404 bundle_tree.note_id(file_id, path, kind)
405 # this will be overridden in extra_info if executable is specified.405 # this will be overridden in extra_info if executable is specified.
406406
=== modified file 'breezy/bzrdir.py'
--- breezy/bzrdir.py 2017-05-22 00:56:52 +0000
+++ breezy/bzrdir.py 2017-05-30 21:16:02 +0000
@@ -72,10 +72,6 @@
72 controldir,72 controldir,
73 registry,73 registry,
74 )74 )
75from .symbol_versioning import (
76 deprecated_in,
77 deprecated_method,
78 )
7975
8076
81class BzrDir(controldir.ControlDir):77class BzrDir(controldir.ControlDir):
8278
=== modified file 'breezy/commit.py'
--- breezy/commit.py 2017-05-22 00:56:52 +0000
+++ breezy/commit.py 2017-05-30 21:16:02 +0000
@@ -71,7 +71,6 @@
71 )71 )
72from .trace import mutter, note, is_quiet72from .trace import mutter, note, is_quiet
73from .inventory import Inventory, InventoryEntry, make_entry73from .inventory import Inventory, InventoryEntry, make_entry
74from . import symbol_versioning
75from .urlutils import unescape_for_display74from .urlutils import unescape_for_display
76from .i18n import gettext75from .i18n import gettext
7776
@@ -79,11 +78,7 @@
79class NullCommitReporter(object):78class NullCommitReporter(object):
80 """I report on progress of a commit."""79 """I report on progress of a commit."""
8180
82 def started(self, revno, revid, location=None):81 def started(self, revno, revid, location):
83 if location is None:
84 symbol_versioning.warn("As of bzr 1.0 you must pass a location "
85 "to started.", DeprecationWarning,
86 stacklevel=2)
87 pass82 pass
8883
89 def snapshot_change(self, change, path):84 def snapshot_change(self, change, path):
@@ -119,17 +114,10 @@
119 return114 return
120 self._note("%s %s", change, path)115 self._note("%s %s", change, path)
121116
122 def started(self, revno, rev_id, location=None):117 def started(self, revno, rev_id, location):
123 if location is not None:118 self._note(
124 location = ' to: ' + unescape_for_display(location, 'utf-8')119 gettext('Committing to: %s'),
125 else:120 unescape_for_display(location, 'utf-8'))
126 # When started was added, location was only made optional by
127 # accident. Matt Nordhoff 20071129
128 symbol_versioning.warn("As of bzr 1.0 you must pass a location "
129 "to started.", DeprecationWarning,
130 stacklevel=2)
131 location = ''
132 self._note(gettext('Committing%s'), location)
133121
134 def completed(self, revno, rev_id):122 def completed(self, revno, rev_id):
135 self._note(gettext('Committed revision %d.'), revno)123 self._note(gettext('Committed revision %d.'), revno)
@@ -176,7 +164,7 @@
176 self.config_stack = config_stack164 self.config_stack = config_stack
177165
178 @staticmethod166 @staticmethod
179 def update_revprops(revprops, branch, authors=None, author=None,167 def update_revprops(revprops, branch, authors=None,
180 local=False, possible_master_transports=None):168 local=False, possible_master_transports=None):
181 if revprops is None:169 if revprops is None:
182 revprops = {}170 revprops = {}
@@ -187,9 +175,6 @@
187 local,175 local,
188 possible_master_transports)176 possible_master_transports)
189 if authors is not None:177 if authors is not None:
190 if author is not None:
191 raise AssertionError('Specifying both author and authors '
192 'is not allowed. Specify just authors instead')
193 if 'author' in revprops or 'authors' in revprops:178 if 'author' in revprops or 'authors' in revprops:
194 # XXX: maybe we should just accept one of them?179 # XXX: maybe we should just accept one of them?
195 raise AssertionError('author property given twice')180 raise AssertionError('author property given twice')
@@ -199,17 +184,6 @@
199 raise AssertionError('\\n is not a valid character '184 raise AssertionError('\\n is not a valid character '
200 'in an author identity')185 'in an author identity')
201 revprops['authors'] = '\n'.join(authors)186 revprops['authors'] = '\n'.join(authors)
202 if author is not None:
203 symbol_versioning.warn('The parameter author was deprecated'
204 ' in version 1.13. Use authors instead',
205 DeprecationWarning)
206 if 'author' in revprops or 'authors' in revprops:
207 # XXX: maybe we should just accept one of them?
208 raise AssertionError('author property given twice')
209 if '\n' in author:
210 raise AssertionError('\\n is not a valid character '
211 'in an author identity')
212 revprops['authors'] = author
213 return revprops187 return revprops
214188
215 def commit(self,189 def commit(self,
216190
=== modified file 'breezy/config.py'
--- breezy/config.py 2017-05-25 01:35:55 +0000
+++ breezy/config.py 2017-05-30 21:16:02 +0000
@@ -97,7 +97,6 @@
97 lockdir,97 lockdir,
98 mergetools,98 mergetools,
99 osutils,99 osutils,
100 symbol_versioning,
101 trace,100 trace,
102 transport,101 transport,
103 ui,102 ui,
@@ -118,10 +117,6 @@
118 text_type,117 text_type,
119 string_types,118 string_types,
120 )119 )
121from .symbol_versioning import (
122 deprecated_in,
123 deprecated_method,
124 )
125120
126121
127CHECK_IF_POSSIBLE=0122CHECK_IF_POSSIBLE=0
@@ -445,65 +440,6 @@
445 l = [l]440 l = [l]
446 return l441 return l
447442
448 @deprecated_method(deprecated_in((2, 5, 0)))
449 def get_user_option_as_int_from_SI(self, option_name, default=None):
450 """Get a generic option from a human readable size in SI units, e.g 10MB
451
452 Accepted suffixes are K,M,G. It is case-insensitive and may be followed
453 by a trailing b (i.e. Kb, MB). This is intended to be practical and not
454 pedantic.
455
456 :return Integer, expanded to its base-10 value if a proper SI unit is
457 found. If the option doesn't exist, or isn't a value in
458 SI units, return default (which defaults to None)
459 """
460 val = self.get_user_option(option_name)
461 if isinstance(val, list):
462 val = val[0]
463 if val is None:
464 val = default
465 else:
466 p = re.compile("^(\d+)([kmg])*b*$", re.IGNORECASE)
467 try:
468 m = p.match(val)
469 if m is not None:
470 val = int(m.group(1))
471 if m.group(2) is not None:
472 if m.group(2).lower() == 'k':
473 val *= 10**3
474 elif m.group(2).lower() == 'm':
475 val *= 10**6
476 elif m.group(2).lower() == 'g':
477 val *= 10**9
478 else:
479 ui.ui_factory.show_warning(gettext('Invalid config value for "{0}" '
480 ' value {1!r} is not an SI unit.').format(
481 option_name, val))
482 val = default
483 except TypeError:
484 val = default
485 return val
486
487 @deprecated_method(deprecated_in((2, 5, 0)))
488 def gpg_signing_command(self):
489 """What program should be used to sign signatures?"""
490 result = self._gpg_signing_command()
491 if result is None:
492 result = "gpg"
493 return result
494
495 def _gpg_signing_command(self):
496 """See gpg_signing_command()."""
497 return None
498
499 @deprecated_method(deprecated_in((2, 5, 0)))
500 def log_format(self):
501 """What log format should be used"""
502 result = self._log_format()
503 if result is None:
504 result = "long"
505 return result
506
507 def _log_format(self):443 def _log_format(self):
508 """See log_format()."""444 """See log_format()."""
509 return None445 return None
@@ -521,25 +457,6 @@
521 """See validate_signatures_in_log()."""457 """See validate_signatures_in_log()."""
522 return None458 return None
523459
524 @deprecated_method(deprecated_in((2, 5, 0)))
525 def acceptable_keys(self):
526 """Comma separated list of key patterns acceptable to
527 verify-signatures command"""
528 result = self._acceptable_keys()
529 return result
530
531 def _acceptable_keys(self):
532 """See acceptable_keys()."""
533 return None
534
535 @deprecated_method(deprecated_in((2, 5, 0)))
536 def post_commit(self):
537 """An ordered list of python functions to call.
538
539 Each function takes branch, rev_id as parameters.
540 """
541 return self._post_commit()
542
543 def _post_commit(self):460 def _post_commit(self):
544 """See Config.post_commit."""461 """See Config.post_commit."""
545 return None462 return None
@@ -573,46 +490,6 @@
573 """490 """
574 self.username()491 self.username()
575492
576 @deprecated_method(deprecated_in((2, 5, 0)))
577 def signature_checking(self):
578 """What is the current policy for signature checking?."""
579 policy = self._get_signature_checking()
580 if policy is not None:
581 return policy
582 return CHECK_IF_POSSIBLE
583
584 @deprecated_method(deprecated_in((2, 5, 0)))
585 def signing_policy(self):
586 """What is the current policy for signature checking?."""
587 policy = self._get_signing_policy()
588 if policy is not None:
589 return policy
590 return SIGN_WHEN_REQUIRED
591
592 @deprecated_method(deprecated_in((2, 5, 0)))
593 def signature_needed(self):
594 """Is a signature needed when committing ?."""
595 policy = self._get_signing_policy()
596 if policy is None:
597 policy = self._get_signature_checking()
598 if policy is not None:
599 #this warning should go away once check_signatures is
600 #implemented (if not before)
601 trace.warning("Please use create_signatures,"
602 " not check_signatures to set signing policy.")
603 elif policy == SIGN_ALWAYS:
604 return True
605 return False
606
607 @deprecated_method(deprecated_in((2, 5, 0)))
608 def gpg_signing_key(self):
609 """GPG user-id to sign commits"""
610 key = self.get_user_option('gpg_signing_key')
611 if key == "default" or key == None:
612 return self.user_email()
613 else:
614 return key
615
616 def get_alias(self, value):493 def get_alias(self, value):
617 return self._get_alias(value)494 return self._get_alias(value)
618495
@@ -740,24 +617,14 @@
740class IniBasedConfig(Config):617class IniBasedConfig(Config):
741 """A configuration policy that draws from ini files."""618 """A configuration policy that draws from ini files."""
742619
743 def __init__(self, get_filename=symbol_versioning.DEPRECATED_PARAMETER,620 def __init__(self, file_name=None):
744 file_name=None):
745 """Base class for configuration files using an ini-like syntax.621 """Base class for configuration files using an ini-like syntax.
746622
747 :param file_name: The configuration file path.623 :param file_name: The configuration file path.
748 """624 """
749 super(IniBasedConfig, self).__init__()625 super(IniBasedConfig, self).__init__()
750 self.file_name = file_name626 self.file_name = file_name
751 if symbol_versioning.deprecated_passed(get_filename):627 self.file_name = file_name
752 symbol_versioning.warn(
753 'IniBasedConfig.__init__(get_filename) was deprecated in 2.3.'
754 ' Use file_name instead.',
755 DeprecationWarning,
756 stacklevel=2)
757 if get_filename is not None:
758 self.file_name = get_filename()
759 else:
760 self.file_name = file_name
761 self._content = None628 self._content = None
762 self._parser = None629 self._parser = None
763630
@@ -783,15 +650,9 @@
783 if save:650 if save:
784 self._write_config_file()651 self._write_config_file()
785652
786 def _get_parser(self, file=symbol_versioning.DEPRECATED_PARAMETER):653 def _get_parser(self):
787 if self._parser is not None:654 if self._parser is not None:
788 return self._parser655 return self._parser
789 if symbol_versioning.deprecated_passed(file):
790 symbol_versioning.warn(
791 'IniBasedConfig._get_parser(file=xxx) was deprecated in 2.3.'
792 ' Use IniBasedConfig(_content=xxx) instead.',
793 DeprecationWarning,
794 stacklevel=2)
795 if self._content is not None:656 if self._content is not None:
796 co_input = self._content657 co_input = self._content
797 elif self.file_name is None:658 elif self.file_name is None:
@@ -1277,26 +1138,6 @@
12771138
1278 def _set_option_policy(self, section, option_name, option_policy):1139 def _set_option_policy(self, section, option_name, option_policy):
1279 """Set the policy for the given option name in the given section."""1140 """Set the policy for the given option name in the given section."""
1280 # The old recurse=False option affects all options in the
1281 # section. To handle multiple policies in the section, we
1282 # need to convert it to a policy_norecurse key.
1283 try:
1284 recurse = self._get_parser()[section].as_bool('recurse')
1285 except KeyError:
1286 pass
1287 else:
1288 symbol_versioning.warn(
1289 'The recurse option is deprecated as of 0.14. '
1290 'The section "%s" has been converted to use policies.'
1291 % section,
1292 DeprecationWarning)
1293 del self._get_parser()[section]['recurse']
1294 if not recurse:
1295 for key in self._get_parser()[section].keys():
1296 if not key.endswith(':policy'):
1297 self._get_parser()[section][key +
1298 ':policy'] = 'norecurse'
1299
1300 policy_key = option_name + ':policy'1141 policy_key = option_name + ':policy'
1301 policy_name = _policy_name[option_policy]1142 policy_name = _policy_name[option_policy]
1302 if policy_name is not None:1143 if policy_name is not None:
13031144
=== modified file 'breezy/conflicts.py'
--- breezy/conflicts.py 2017-05-22 00:56:52 +0000
+++ breezy/conflicts.py 2017-05-30 21:16:02 +0000
@@ -37,6 +37,7 @@
37from breezy.i18n import gettext, ngettext37from breezy.i18n import gettext, ngettext
38""")38""")
39from . import (39from . import (
40 cache_utf8,
40 commands,41 commands,
41 option,42 option,
42 registry,43 registry,
@@ -368,9 +369,11 @@
368369
369 def __init__(self, path, file_id=None):370 def __init__(self, path, file_id=None):
370 self.path = path371 self.path = path
371 # warn turned off, because the factory blindly transfers the Stanza372 # the factory blindly transfers the Stanza values to __init__ and
372 # values to __init__ and Stanza is purely a Unicode api.373 # Stanza is purely a Unicode api.
373 self.file_id = osutils.safe_file_id(file_id, warn=False)374 if isinstance(file_id, unicode):
375 file_id = cache_utf8.encode(file_id)
376 self.file_id = osutils.safe_file_id(file_id)
374377
375 def as_stanza(self):378 def as_stanza(self):
376 s = rio.Stanza(type=self.typestring, path=self.path)379 s = rio.Stanza(type=self.typestring, path=self.path)
@@ -711,10 +714,11 @@
711 conflict_file_id=None):714 conflict_file_id=None):
712 HandledConflict.__init__(self, action, path, file_id)715 HandledConflict.__init__(self, action, path, file_id)
713 self.conflict_path = conflict_path716 self.conflict_path = conflict_path
714 # warn turned off, because the factory blindly transfers the Stanza717 # the factory blindly transfers the Stanza values to __init__,
715 # values to __init__.718 # so they can be unicode.
716 self.conflict_file_id = osutils.safe_file_id(conflict_file_id,719 if isinstance(conflict_file_id, unicode):
717 warn=False)720 conflict_file_id = cache_utf8.encode(conflict_file_id)
721 self.conflict_file_id = osutils.safe_file_id(conflict_file_id)
718722
719 def _cmp_list(self):723 def _cmp_list(self):
720 return HandledConflict._cmp_list(self) + [self.conflict_path,724 return HandledConflict._cmp_list(self) + [self.conflict_path,
721725
=== modified file 'breezy/filters/__init__.py'
--- breezy/filters/__init__.py 2017-05-22 00:56:52 +0000
+++ breezy/filters/__init__.py 2017-05-30 21:16:02 +0000
@@ -52,10 +52,6 @@
52from ..sixish import (52from ..sixish import (
53 BytesIO,53 BytesIO,
54 )54 )
55from ..symbol_versioning import (
56 deprecated_function,
57 deprecated_in,
58 )
5955
6056
61class ContentFilter(object):57class ContentFilter(object):
@@ -190,33 +186,6 @@
190_stack_cache = {}186_stack_cache = {}
191187
192188
193# XXX: This function doesn't have any tests. JRV 2012-03-29
194@deprecated_function(deprecated_in((2, 6, 0)))
195def register_filter_stack_map(name, stack_map_lookup):
196 """Register the filter stacks to use for various preference values.
197
198 :param name: the preference/filter-stack name
199 :param stack_map_lookup: a callable where
200 the parameter is the preference value to match and
201 the result is the matching stack of filters to use,
202 or None if none.
203 """
204 filter_stacks_registry.register(name, stack_map_lookup)
205
206
207# XXX: This function doesn't have any tests. JRV 2012-03-29
208@deprecated_function(deprecated_in((2, 6, 0)))
209def lazy_register_filter_stack_map(name, module_name, member_name):
210 """Lazily register the filter stacks to use for various preference values.
211
212 :param name: the preference/filter-stack name
213 :param module_name: The python path to the module of the filter stack map.
214 :param member_name: The name of the stack_map_lookup callable
215 in the module.
216 """
217 filter_stacks_registry.register_lazy(name, module_name, member_name)
218
219
220def _get_registered_names():189def _get_registered_names():
221 """Get the list of names with filters registered."""190 """Get the list of names with filters registered."""
222 # Note: We may want to intelligently order these later.191 # Note: We may want to intelligently order these later.
223192
=== modified file 'breezy/gpg.py'
--- breezy/gpg.py 2017-05-22 00:56:52 +0000
+++ breezy/gpg.py 2017-05-30 21:16:02 +0000
@@ -42,10 +42,6 @@
42from .sixish import (42from .sixish import (
43 BytesIO,43 BytesIO,
44 )44 )
45from .symbol_versioning import (
46 deprecated_in,
47 deprecated_method,
48 )
4945
50#verification results46#verification results
51SIGNATURE_VALID = 047SIGNATURE_VALID = 0
@@ -144,30 +140,6 @@
144 else:140 else:
145 self.acceptable_keys.append(pattern)141 self.acceptable_keys.append(pattern)
146142
147 @deprecated_method(deprecated_in((2, 6, 0)))
148 def do_verifications(self, revisions, repository):
149 return bulk_verify_signatures(repository, revisions, self)
150
151 @deprecated_method(deprecated_in((2, 6, 0)))
152 def valid_commits_message(self, count):
153 return valid_commits_message(count)
154
155 @deprecated_method(deprecated_in((2, 6, 0)))
156 def unknown_key_message(self, count):
157 return unknown_key_message(count)
158
159 @deprecated_method(deprecated_in((2, 6, 0)))
160 def commit_not_valid_message(self, count):
161 return commit_not_valid_message(count)
162
163 @deprecated_method(deprecated_in((2, 6, 0)))
164 def commit_not_signed_message(self, count):
165 return commit_not_signed_message(count)
166
167 @deprecated_method(deprecated_in((2, 6, 0)))
168 def expired_commit_message(self, count):
169 return expired_commit_message(count)
170
171143
172def _set_gpg_tty():144def _set_gpg_tty():
173 tty = os.environ.get('TTY')145 tty = os.environ.get('TTY')
@@ -360,73 +332,6 @@
360 "No GnuPG key results for pattern: {0}"332 "No GnuPG key results for pattern: {0}"
361 ).format(pattern))333 ).format(pattern))
362334
363 @deprecated_method(deprecated_in((2, 6, 0)))
364 def do_verifications(self, revisions, repository,
365 process_events_callback=None):
366 """do verifications on a set of revisions
367
368 :param revisions: list of revision ids to verify
369 :param repository: repository object
370 :param process_events_callback: method to call for GUI frontends that
371 want to keep their UI refreshed
372
373 :return: count dictionary of results of each type,
374 result list for each revision,
375 boolean True if all results are verified successfully
376 """
377 return bulk_verify_signatures(repository, revisions, self,
378 process_events_callback)
379
380 @deprecated_method(deprecated_in((2, 6, 0)))
381 def verbose_valid_message(self, result):
382 """takes a verify result and returns list of signed commits strings"""
383 return verbose_valid_message(result)
384
385 @deprecated_method(deprecated_in((2, 6, 0)))
386 def verbose_not_valid_message(self, result, repo):
387 """takes a verify result and returns list of not valid commit info"""
388 return verbose_not_valid_message(result, repo)
389
390 @deprecated_method(deprecated_in((2, 6, 0)))
391 def verbose_not_signed_message(self, result, repo):
392 """takes a verify result and returns list of not signed commit info"""
393 return verbose_not_valid_message(result, repo)
394
395 @deprecated_method(deprecated_in((2, 6, 0)))
396 def verbose_missing_key_message(self, result):
397 """takes a verify result and returns list of missing key info"""
398 return verbose_missing_key_message(result)
399
400 @deprecated_method(deprecated_in((2, 6, 0)))
401 def verbose_expired_key_message(self, result, repo):
402 """takes a verify result and returns list of expired key info"""
403 return verbose_expired_key_message(result, repo)
404
405 @deprecated_method(deprecated_in((2, 6, 0)))
406 def valid_commits_message(self, count):
407 """returns message for number of commits"""
408 return valid_commits_message(count)
409
410 @deprecated_method(deprecated_in((2, 6, 0)))
411 def unknown_key_message(self, count):
412 """returns message for number of commits"""
413 return unknown_key_message(count)
414
415 @deprecated_method(deprecated_in((2, 6, 0)))
416 def commit_not_valid_message(self, count):
417 """returns message for number of commits"""
418 return commit_not_valid_message(count)
419
420 @deprecated_method(deprecated_in((2, 6, 0)))
421 def commit_not_signed_message(self, count):
422 """returns message for number of commits"""
423 return commit_not_signed_message(count)
424
425 @deprecated_method(deprecated_in((2, 6, 0)))
426 def expired_commit_message(self, count):
427 """returns message for number of commits"""
428 return expired_commit_message(count)
429
430335
431def valid_commits_message(count):336def valid_commits_message(count):
432 """returns message for number of commits"""337 """returns message for number of commits"""
433338
=== modified file 'breezy/hooks.py'
--- breezy/hooks.py 2017-05-22 00:56:52 +0000
+++ breezy/hooks.py 2017-05-30 21:16:02 +0000
@@ -20,7 +20,6 @@
2020
21from . import (21from . import (
22 registry,22 registry,
23 symbol_versioning,
24 )23 )
25from .lazy_import import lazy_import24from .lazy_import import lazy_import
26lazy_import(globals(), """25lazy_import(globals(), """
2726
=== modified file 'breezy/inventory.py'
--- breezy/inventory.py 2017-05-22 00:56:52 +0000
+++ breezy/inventory.py 2017-05-30 21:16:02 +0000
@@ -50,10 +50,6 @@
50 )50 )
5151
52from .static_tuple import StaticTuple52from .static_tuple import StaticTuple
53from .symbol_versioning import (
54 deprecated_in,
55 deprecated_method,
56 )
5753
5854
59class InventoryEntry(object):55class InventoryEntry(object):
6056
=== modified file 'breezy/lru_cache.py'
--- breezy/lru_cache.py 2017-05-22 00:56:52 +0000
+++ breezy/lru_cache.py 2017-05-30 21:16:02 +0000
@@ -19,7 +19,6 @@
19from __future__ import absolute_import19from __future__ import absolute_import
2020
21from . import (21from . import (
22 symbol_versioning,
23 trace,22 trace,
24 )23 )
2524
@@ -93,13 +92,6 @@
93 def __len__(self):92 def __len__(self):
94 return len(self._cache)93 return len(self._cache)
9594
96 @symbol_versioning.deprecated_method(
97 symbol_versioning.deprecated_in((2, 5, 0)))
98 def add(self, key, value, cleanup=None):
99 if cleanup is not None:
100 raise ValueError("Per-node cleanup functions no longer supported")
101 return self.__setitem__(key, value)
102
103 def __setitem__(self, key, value):95 def __setitem__(self, key, value):
104 """Add a new value to the cache"""96 """Add a new value to the cache"""
105 if key is _null_key:97 if key is _null_key:
@@ -143,9 +135,6 @@
143 """Get a new dict with the same key:value pairs as the cache"""135 """Get a new dict with the same key:value pairs as the cache"""
144 return dict((k, n.value) for k, n in self._cache.iteritems())136 return dict((k, n.value) for k, n in self._cache.iteritems())
145137
146 items = symbol_versioning.deprecated_method(
147 symbol_versioning.deprecated_in((2, 5, 0)))(as_dict)
148
149 def cleanup(self):138 def cleanup(self):
150 """Clear the cache until it shrinks to the requested size.139 """Clear the cache until it shrinks to the requested size.
151140
152141
=== modified file 'breezy/merge.py'
--- breezy/merge.py 2017-05-22 00:56:52 +0000
+++ breezy/merge.py 2017-05-30 21:16:02 +0000
@@ -48,10 +48,6 @@
48 hooks,48 hooks,
49 registry,49 registry,
50 )50 )
51from .symbol_versioning import (
52 deprecated_in,
53 deprecated_method,
54 )
55# TODO: Report back as changes are merged in51# TODO: Report back as changes are merged in
5652
5753
5854
=== modified file 'breezy/missing.py'
--- breezy/missing.py 2017-05-22 00:56:52 +0000
+++ breezy/missing.py 2017-05-30 21:16:02 +0000
@@ -20,7 +20,6 @@
2020
21from . import (21from . import (
22 log,22 log,
23 symbol_versioning,
24 )23 )
25from . import revision as _mod_revision24from . import revision as _mod_revision
2625
@@ -50,8 +49,7 @@
5049
51def find_unmerged(local_branch, remote_branch, restrict='all',50def find_unmerged(local_branch, remote_branch, restrict='all',
52 include_merged=None, backward=False,51 include_merged=None, backward=False,
53 local_revid_range=None, remote_revid_range=None,52 local_revid_range=None, remote_revid_range=None):
54 include_merges=symbol_versioning.DEPRECATED_PARAMETER):
55 """Find revisions from each side that have not been merged.53 """Find revisions from each side that have not been merged.
5654
57 :param local_branch: Compare the history of local_branch55 :param local_branch: Compare the history of local_branch
@@ -69,18 +67,10 @@
69 revisions (lower bound, upper bound)67 revisions (lower bound, upper bound)
70 :param remote_revid_range: Revision-id range for filtering remote_branch68 :param remote_revid_range: Revision-id range for filtering remote_branch
71 revisions (lower bound, upper bound)69 revisions (lower bound, upper bound)
72 :param include_merges: Deprecated historical alias for include_merged
7370
74 :return: A list of [(revno, revision_id)] for the mainline revisions on71 :return: A list of [(revno, revision_id)] for the mainline revisions on
75 each side.72 each side.
76 """73 """
77 if symbol_versioning.deprecated_passed(include_merges):
78 symbol_versioning.warn(
79 'include_merges was deprecated in 2.5.'
80 ' Use include_merged instead.',
81 DeprecationWarning, stacklevel=2)
82 if include_merged is None:
83 include_merged = include_merges
84 if include_merged is None:74 if include_merged is None:
85 include_merged = False75 include_merged = False
86 local_branch.lock_read()76 local_branch.lock_read()
8777
=== modified file 'breezy/mutabletree.py'
--- breezy/mutabletree.py 2017-05-25 01:35:55 +0000
+++ breezy/mutabletree.py 2017-05-30 21:16:02 +0000
@@ -189,8 +189,7 @@
189 raise NotImplementedError(self.apply_inventory_delta)189 raise NotImplementedError(self.apply_inventory_delta)
190190
191 @needs_write_lock191 @needs_write_lock
192 def commit(self, message=None, revprops=None, *args,192 def commit(self, message=None, revprops=None, *args, **kwargs):
193 **kwargs):
194 # avoid circular imports193 # avoid circular imports
195 from breezy import commit194 from breezy import commit
196 possible_master_transports=[]195 possible_master_transports=[]
@@ -198,7 +197,6 @@
198 revprops,197 revprops,
199 self.branch,198 self.branch,
200 kwargs.pop('authors', None),199 kwargs.pop('authors', None),
201 kwargs.pop('author', None),
202 kwargs.get('local', False),200 kwargs.get('local', False),
203 possible_master_transports)201 possible_master_transports)
204 # args for wt.commit start at message from the Commit.commit method,202 # args for wt.commit start at message from the Commit.commit method,
205203
=== modified file 'breezy/osutils.py'
--- breezy/osutils.py 2017-05-30 19:39:52 +0000
+++ breezy/osutils.py 2017-05-30 21:16:02 +0000
@@ -46,7 +46,6 @@
46import unicodedata46import unicodedata
4747
48from breezy import (48from breezy import (
49 cache_utf8,
50 config,49 config,
51 errors,50 errors,
52 trace,51 trace,
@@ -59,13 +58,6 @@
59 PY3,58 PY3,
60 text_type,59 text_type,
61 )60 )
62from .symbol_versioning import (
63 DEPRECATED_PARAMETER,
64 deprecated_function,
65 deprecated_in,
66 deprecated_passed,
67 warn as warn_deprecated,
68 )
6961
70from hashlib import (62from hashlib import (
71 md5,63 md5,
@@ -74,7 +66,7 @@
7466
7567
76import breezy68import breezy
77from . import symbol_versioning, _fs_enc69from . import _fs_enc
7870
7971
80# Cross platform wall-clock time functionality with decent resolution.72# Cross platform wall-clock time functionality with decent resolution.
@@ -1415,33 +1407,22 @@
1415 return unicode_or_utf8_string.encode('utf-8')1407 return unicode_or_utf8_string.encode('utf-8')
14161408
14171409
1418_revision_id_warning = ('Unicode revision ids were deprecated in bzr 0.15.'1410def safe_revision_id(unicode_or_utf8_string):
1419 ' Revision id generators should be creating utf8'
1420 ' revision ids.')
1421
1422
1423def safe_revision_id(unicode_or_utf8_string, warn=True):
1424 """Revision ids should now be utf8, but at one point they were unicode.1411 """Revision ids should now be utf8, but at one point they were unicode.
14251412
1426 :param unicode_or_utf8_string: A possibly Unicode revision_id. (can also be1413 :param unicode_or_utf8_string: A possibly Unicode revision_id. (can also be
1427 utf8 or None).1414 utf8 or None).
1428 :param warn: Functions that are sanitizing user data can set warn=False
1429 :return: None or a utf8 revision id.1415 :return: None or a utf8 revision id.
1430 """1416 """
1431 if (unicode_or_utf8_string is None1417 if (unicode_or_utf8_string is None
1432 or unicode_or_utf8_string.__class__ == str):1418 or unicode_or_utf8_string.__class__ == str):
1433 return unicode_or_utf8_string1419 return unicode_or_utf8_string
1434 if warn:1420 raise TypeError('Unicode revision ids are no longer supported. '
1435 symbol_versioning.warn(_revision_id_warning, DeprecationWarning,1421 'Revision id generators should be creating utf8 revision '
1436 stacklevel=2)1422 'ids.')
1437 return cache_utf8.encode(unicode_or_utf8_string)1423
14381424
14391425def safe_file_id(unicode_or_utf8_string):
1440_file_id_warning = ('Unicode file ids were deprecated in bzr 0.15. File id'
1441 ' generators should be creating utf8 file ids.')
1442
1443
1444def safe_file_id(unicode_or_utf8_string, warn=True):
1445 """File ids should now be utf8, but at one point they were unicode.1426 """File ids should now be utf8, but at one point they were unicode.
14461427
1447 This is the same as safe_utf8, except it uses the cached encode functions1428 This is the same as safe_utf8, except it uses the cached encode functions
@@ -1449,16 +1430,13 @@
14491430
1450 :param unicode_or_utf8_string: A possibly Unicode file_id. (can also be1431 :param unicode_or_utf8_string: A possibly Unicode file_id. (can also be
1451 utf8 or None).1432 utf8 or None).
1452 :param warn: Functions that are sanitizing user data can set warn=False
1453 :return: None or a utf8 file id.1433 :return: None or a utf8 file id.
1454 """1434 """
1455 if (unicode_or_utf8_string is None1435 if (unicode_or_utf8_string is None
1456 or unicode_or_utf8_string.__class__ == str):1436 or unicode_or_utf8_string.__class__ == str):
1457 return unicode_or_utf8_string1437 return unicode_or_utf8_string
1458 if warn:1438 raise TypeError('Unicode file ids are no longer supported. '
1459 symbol_versioning.warn(_file_id_warning, DeprecationWarning,1439 'File id generators should be creating utf8 file ids.')
1460 stacklevel=2)
1461 return cache_utf8.encode(unicode_or_utf8_string)
14621440
14631441
1464_platform_normalizes_filenames = False1442_platform_normalizes_filenames = False
@@ -2034,7 +2012,7 @@
2034_cached_user_encoding = None2012_cached_user_encoding = None
20352013
20362014
2037def get_user_encoding(use_cache=DEPRECATED_PARAMETER):2015def get_user_encoding():
2038 """Find out what the preferred user encoding is.2016 """Find out what the preferred user encoding is.
20392017
2040 This is generally the encoding that is used for command line parameters2018 This is generally the encoding that is used for command line parameters
@@ -2044,9 +2022,6 @@
2044 :return: A string defining the preferred user encoding2022 :return: A string defining the preferred user encoding
2045 """2023 """
2046 global _cached_user_encoding2024 global _cached_user_encoding
2047 if deprecated_passed(use_cache):
2048 warn_deprecated("use_cache should only have been used for tests",
2049 DeprecationWarning, stacklevel=2)
2050 if _cached_user_encoding is not None:2025 if _cached_user_encoding is not None:
2051 return _cached_user_encoding2026 return _cached_user_encoding
20522027
@@ -2319,30 +2294,6 @@
2319 raise2294 raise
23202295
23212296
2322@deprecated_function(deprecated_in((2, 2, 0)))
2323def re_compile_checked(re_string, flags=0, where=""):
2324 """Return a compiled re, or raise a sensible error.
2325
2326 This should only be used when compiling user-supplied REs.
2327
2328 :param re_string: Text form of regular expression.
2329 :param flags: eg re.IGNORECASE
2330 :param where: Message explaining to the user the context where
2331 it occurred, eg 'log search filter'.
2332 """
2333 # from https://bugs.launchpad.net/bzr/+bug/251352
2334 try:
2335 re_obj = re.compile(re_string, flags)
2336 re_obj.search("")
2337 return re_obj
2338 except errors.InvalidPattern as e:
2339 if where:
2340 where = ' in ' + where
2341 # despite the name 'error' is a type
2342 raise errors.BzrCommandError('Invalid regular expression%s: %s'
2343 % (where, e.msg))
2344
2345
2346if sys.platform == "win32":2297if sys.platform == "win32":
2347 def getchar():2298 def getchar():
2348 import msvcrt2299 import msvcrt
23492300
=== modified file 'breezy/plugins/weave_fmt/bzrdir.py'
--- breezy/plugins/weave_fmt/bzrdir.py 2017-05-25 01:35:55 +0000
+++ breezy/plugins/weave_fmt/bzrdir.py 2017-05-30 21:16:02 +0000
@@ -874,14 +874,10 @@
874 return self.transport874 return self.transport
875 raise errors.IncompatibleFormat(workingtree_format, self._format)875 raise errors.IncompatibleFormat(workingtree_format, self._format)
876876
877 def needs_format_conversion(self, format=None):877 def needs_format_conversion(self, format):
878 """See ControlDir.needs_format_conversion()."""878 """See ControlDir.needs_format_conversion()."""
879 # if the format is not the same as the system default,879 # if the format is not the same as the system default,
880 # an upgrade is needed.880 # an upgrade is needed.
881 if format is None:
882 symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0))
883 % 'needs_format_conversion(format=None)')
884 format = BzrDirFormat.get_default_format()
885 return not isinstance(self._format, format.__class__)881 return not isinstance(self._format, format.__class__)
886882
887 def open_branch(self, name=None, unsupported=False,883 def open_branch(self, name=None, unsupported=False,
@@ -945,11 +941,8 @@
945 """See ControlDir.create_repository."""941 """See ControlDir.create_repository."""
946 return self._format.repository_format.initialize(self, shared)942 return self._format.repository_format.initialize(self, shared)
947943
948 def needs_format_conversion(self, format=None):944 def needs_format_conversion(self, format):
949 """Format 4 dirs are always in need of conversion."""945 """Format 4 dirs are always in need of conversion."""
950 if format is None:
951 symbol_versioning.warn(symbol_versioning.deprecated_in((1, 13, 0))
952 % 'needs_format_conversion(format=None)')
953 return True946 return True
954947
955 def open_repository(self):948 def open_repository(self):
956949
=== modified file 'breezy/plugins/weave_fmt/repository.py'
--- breezy/plugins/weave_fmt/repository.py 2017-05-22 00:56:52 +0000
+++ breezy/plugins/weave_fmt/repository.py 2017-05-30 21:16:02 +0000
@@ -41,7 +41,6 @@
41 lockable_files,41 lockable_files,
42 lockdir,42 lockdir,
43 osutils,43 osutils,
44 symbol_versioning,
45 trace,44 trace,
46 tuned_gzip,45 tuned_gzip,
47 urlutils,46 urlutils,
@@ -822,7 +821,6 @@
822821
823 @needs_read_lock822 @needs_read_lock
824 def search_missing_revision_ids(self,823 def search_missing_revision_ids(self,
825 revision_id=symbol_versioning.DEPRECATED_PARAMETER,
826 find_ghosts=True, revision_ids=None, if_present_ids=None,824 find_ghosts=True, revision_ids=None, if_present_ids=None,
827 limit=None):825 limit=None):
828 """See InterRepository.search_missing_revision_ids()."""826 """See InterRepository.search_missing_revision_ids()."""
@@ -837,17 +835,6 @@
837 # disk format scales terribly for push anyway due to rewriting835 # disk format scales terribly for push anyway due to rewriting
838 # inventory.weave, this is considered acceptable.836 # inventory.weave, this is considered acceptable.
839 # - RBC 20060209837 # - RBC 20060209
840 if symbol_versioning.deprecated_passed(revision_id):
841 symbol_versioning.warn(
842 'search_missing_revision_ids(revision_id=...) was '
843 'deprecated in 2.4. Use revision_ids=[...] instead.',
844 DeprecationWarning, stacklevel=2)
845 if revision_ids is not None:
846 raise AssertionError(
847 'revision_ids is mutually exclusive with revision_id')
848 if revision_id is not None:
849 revision_ids = [revision_id]
850 del revision_id
851 source_ids_set = self._present_source_revisions_for(838 source_ids_set = self._present_source_revisions_for(
852 revision_ids, if_present_ids)839 revision_ids, if_present_ids)
853 # source_ids is the worst possible case we may need to pull.840 # source_ids is the worst possible case we may need to pull.
854841
=== modified file 'breezy/remote.py'
--- breezy/remote.py 2017-05-25 01:35:55 +0000
+++ breezy/remote.py 2017-05-30 21:16:02 +0000
@@ -37,7 +37,6 @@
37 repository as _mod_repository,37 repository as _mod_repository,
38 revision as _mod_revision,38 revision as _mod_revision,
39 static_tuple,39 static_tuple,
40 symbol_versioning,
41 testament as _mod_testament,40 testament as _mod_testament,
42 urlutils,41 urlutils,
43 vf_repository,42 vf_repository,
@@ -2101,7 +2100,6 @@
21012100
2102 @needs_read_lock2101 @needs_read_lock
2103 def search_missing_revision_ids(self, other,2102 def search_missing_revision_ids(self, other,
2104 revision_id=symbol_versioning.DEPRECATED_PARAMETER,
2105 find_ghosts=True, revision_ids=None, if_present_ids=None,2103 find_ghosts=True, revision_ids=None, if_present_ids=None,
2106 limit=None):2104 limit=None):
2107 """Return the revision ids that other has that this does not.2105 """Return the revision ids that other has that this does not.
@@ -2110,16 +2108,6 @@
21102108
2111 revision_id: only return revision ids included by revision_id.2109 revision_id: only return revision ids included by revision_id.
2112 """2110 """
2113 if symbol_versioning.deprecated_passed(revision_id):
2114 symbol_versioning.warn(
2115 'search_missing_revision_ids(revision_id=...) was '
2116 'deprecated in 2.4. Use revision_ids=[...] instead.',
2117 DeprecationWarning, stacklevel=2)
2118 if revision_ids is not None:
2119 raise AssertionError(
2120 'revision_ids is mutually exclusive with revision_id')
2121 if revision_id is not None:
2122 revision_ids = [revision_id]
2123 inter_repo = _mod_repository.InterRepository.get(other, self)2111 inter_repo = _mod_repository.InterRepository.get(other, self)
2124 return inter_repo.search_missing_revision_ids(2112 return inter_repo.search_missing_revision_ids(
2125 find_ghosts=find_ghosts, revision_ids=revision_ids,2113 find_ghosts=find_ghosts, revision_ids=revision_ids,
21262114
=== modified file 'breezy/repofmt/knitrepo.py'
--- breezy/repofmt/knitrepo.py 2017-05-22 00:56:52 +0000
+++ breezy/repofmt/knitrepo.py 2017-05-30 21:16:02 +0000
@@ -49,7 +49,6 @@
49 VersionedFileCommitBuilder,49 VersionedFileCommitBuilder,
50 VersionedFileRootCommitBuilder,50 VersionedFileRootCommitBuilder,
51 )51 )
52from .. import symbol_versioning
5352
5453
55class _KnitParentsProvider(object):54class _KnitParentsProvider(object):
5655
=== modified file 'breezy/repository.py'
--- breezy/repository.py 2017-05-25 01:35:55 +0000
+++ breezy/repository.py 2017-05-30 21:16:02 +0000
@@ -43,7 +43,6 @@
43 bzrdir,43 bzrdir,
44 errors,44 errors,
45 registry,45 registry,
46 symbol_versioning,
47 ui,46 ui,
48 )47 )
49from .decorators import needs_read_lock, needs_write_lock, only_raises48from .decorators import needs_read_lock, needs_write_lock, only_raises
@@ -577,25 +576,14 @@
577576
578 @needs_read_lock577 @needs_read_lock
579 def search_missing_revision_ids(self, other,578 def search_missing_revision_ids(self, other,
580 revision_id=symbol_versioning.DEPRECATED_PARAMETER,
581 find_ghosts=True, revision_ids=None, if_present_ids=None,579 find_ghosts=True, revision_ids=None, if_present_ids=None,
582 limit=None):580 limit=None):
583 """Return the revision ids that other has that this does not.581 """Return the revision ids that other has that this does not.
584582
585 These are returned in topological order.583 These are returned in topological order.
586584
587 revision_id: only return revision ids included by revision_id.585 revision_ids: only return revision ids included by revision_id.
588 """586 """
589 if symbol_versioning.deprecated_passed(revision_id):
590 symbol_versioning.warn(
591 'search_missing_revision_ids(revision_id=...) was '
592 'deprecated in 2.4. Use revision_ids=[...] instead.',
593 DeprecationWarning, stacklevel=3)
594 if revision_ids is not None:
595 raise AssertionError(
596 'revision_ids is mutually exclusive with revision_id')
597 if revision_id is not None:
598 revision_ids = [revision_id]
599 return InterRepository.get(other, self).search_missing_revision_ids(587 return InterRepository.get(other, self).search_missing_revision_ids(
600 find_ghosts=find_ghosts, revision_ids=revision_ids,588 find_ghosts=find_ghosts, revision_ids=revision_ids,
601 if_present_ids=if_present_ids, limit=limit)589 if_present_ids=if_present_ids, limit=limit)
@@ -1662,13 +1650,10 @@
16621650
1663 @needs_read_lock1651 @needs_read_lock
1664 def search_missing_revision_ids(self,1652 def search_missing_revision_ids(self,
1665 revision_id=symbol_versioning.DEPRECATED_PARAMETER,
1666 find_ghosts=True, revision_ids=None, if_present_ids=None,1653 find_ghosts=True, revision_ids=None, if_present_ids=None,
1667 limit=None):1654 limit=None):
1668 """Return the revision ids that source has that target does not.1655 """Return the revision ids that source has that target does not.
16691656
1670 :param revision_id: only return revision ids included by this
1671 revision_id.
1672 :param revision_ids: return revision ids included by these1657 :param revision_ids: return revision ids included by these
1673 revision_ids. NoSuchRevision will be raised if any of these1658 revision_ids. NoSuchRevision will be raised if any of these
1674 revisions are not present.1659 revisions are not present.
16751660
=== modified file 'breezy/revision.py'
--- breezy/revision.py 2017-05-22 00:56:52 +0000
+++ breezy/revision.py 2017-05-30 21:16:02 +0000
@@ -26,7 +26,6 @@
26""")26""")
27from . import (27from . import (
28 errors,28 errors,
29 symbol_versioning,
30 )29 )
31from .osutils import contains_whitespace30from .osutils import contains_whitespace
3231
@@ -218,17 +217,14 @@
218def ensure_null(revision_id):217def ensure_null(revision_id):
219 """Ensure only NULL_REVISION is used to represent the null revision"""218 """Ensure only NULL_REVISION is used to represent the null revision"""
220 if revision_id is None:219 if revision_id is None:
221 symbol_versioning.warn('NULL_REVISION should be used for the null'220 raise ValueError(
222 ' revision instead of None, as of bzr 0.91.',221 'NULL_REVISION should be used for the null'
223 DeprecationWarning, stacklevel=2)222 ' revision instead of None.')
224 return NULL_REVISION223 return revision_id
225 else:
226 return revision_id
227224
228225
229def is_null(revision_id):226def is_null(revision_id):
230 if revision_id is None:227 if revision_id is None:
231 symbol_versioning.warn('NULL_REVISION should be used for the null'228 raise ValueError('NULL_REVISION should be used for the null'
232 ' revision instead of None, as of bzr 0.90.',229 ' revision instead of None.')
233 DeprecationWarning, stacklevel=2)230 return (revision_id == NULL_REVISION)
234 return revision_id in (None, NULL_REVISION)
235231
=== modified file 'breezy/revisionspec.py'
--- breezy/revisionspec.py 2017-05-22 00:56:52 +0000
+++ breezy/revisionspec.py 2017-05-30 21:16:02 +0000
@@ -24,9 +24,9 @@
2424
25from breezy import (25from breezy import (
26 branch as _mod_branch,26 branch as _mod_branch,
27 cache_utf8,
27 osutils,28 osutils,
28 revision,29 revision,
29 symbol_versioning,
30 workingtree,30 workingtree,
31 )31 )
32from breezy.i18n import gettext32from breezy.i18n import gettext
@@ -109,16 +109,11 @@
109 self.revno, self.rev_id, self.branch)109 self.revno, self.rev_id, self.branch)
110110
111 @staticmethod111 @staticmethod
112 def from_revision_id(branch, revision_id, revs=symbol_versioning.DEPRECATED_PARAMETER):112 def from_revision_id(branch, revision_id):
113 """Construct a RevisionInfo given just the id.113 """Construct a RevisionInfo given just the id.
114114
115 Use this if you don't know or care what the revno is.115 Use this if you don't know or care what the revno is.
116 """116 """
117 if symbol_versioning.deprecated_passed(revs):
118 symbol_versioning.warn(
119 'RevisionInfo.from_revision_id(revs) was deprecated in 2.5.',
120 DeprecationWarning,
121 stacklevel=2)
122 return RevisionInfo(branch, revno=None, rev_id=revision_id)117 return RevisionInfo(branch, revno=None, rev_id=revision_id)
123118
124119
@@ -142,8 +137,6 @@
142 """137 """
143138
144 prefix = None139 prefix = None
145 # wants_revision_history has been deprecated in 2.5.
146 wants_revision_history = False
147 dwim_catchable_exceptions = (errors.InvalidRevisionSpec,)140 dwim_catchable_exceptions = (errors.InvalidRevisionSpec,)
148 """Exceptions that RevisionSpec_dwim._match_on will catch.141 """Exceptions that RevisionSpec_dwim._match_on will catch.
149142
@@ -185,11 +178,9 @@
185 called directly. Only from RevisionSpec.from_string()178 called directly. Only from RevisionSpec.from_string()
186 """179 """
187 if not _internal:180 if not _internal:
188 symbol_versioning.warn('Creating a RevisionSpec directly has'181 raise AssertionError(
189 ' been deprecated in version 0.11. Use'182 'Creating a RevisionSpec directly is not supported. '
190 ' RevisionSpec.from_string()'183 'Use RevisionSpec.from_string() instead.')
191 ' instead.',
192 DeprecationWarning, stacklevel=2)
193 self.user_spec = spec184 self.user_spec = spec
194 if self.prefix and spec.startswith(self.prefix):185 if self.prefix and spec.startswith(self.prefix):
195 spec = spec[len(self.prefix):]186 spec = spec[len(self.prefix):]
@@ -212,27 +203,7 @@
212 raise errors.InvalidRevisionSpec(self.spec, branch)203 raise errors.InvalidRevisionSpec(self.spec, branch)
213204
214 def in_history(self, branch):205 def in_history(self, branch):
215 if branch:206 return self._match_on_and_check(branch, revs=None)
216 if self.wants_revision_history:
217 symbol_versioning.warn(
218 "RevisionSpec.wants_revision_history was "
219 "deprecated in 2.5 (%s)." % self.__class__.__name__,
220 DeprecationWarning)
221 branch.lock_read()
222 try:
223 graph = branch.repository.get_graph()
224 revs = list(graph.iter_lefthand_ancestry(
225 branch.last_revision(), [revision.NULL_REVISION]))
226 finally:
227 branch.unlock()
228 revs.reverse()
229 else:
230 revs = None
231 else:
232 # this should never trigger.
233 # TODO: make it a deprecated code path. RBC 20060928
234 revs = None
235 return self._match_on_and_check(branch, revs)
236207
237 # FIXME: in_history is somewhat broken,208 # FIXME: in_history is somewhat broken,
238 # it will return non-history revisions in many209 # it will return non-history revisions in many
@@ -341,13 +312,6 @@
341 except rs_class.dwim_catchable_exceptions:312 except rs_class.dwim_catchable_exceptions:
342 pass313 pass
343314
344 # Try the old (deprecated) dwim list:
345 for rs_class in dwim_revspecs:
346 try:
347 return self._try_spectype(rs_class, branch)
348 except rs_class.dwim_catchable_exceptions:
349 pass
350
351 # Well, I dunno what it is. Note that we don't try to keep track of the315 # Well, I dunno what it is. Note that we don't try to keep track of the
352 # first of last exception raised during the DWIM tries as none seems316 # first of last exception raised during the DWIM tries as none seems
353 # really relevant.317 # really relevant.
@@ -502,7 +466,9 @@
502 # self.spec comes straight from parsing the command line arguments,466 # self.spec comes straight from parsing the command line arguments,
503 # so we expect it to be a Unicode string. Switch it to the internal467 # so we expect it to be a Unicode string. Switch it to the internal
504 # representation.468 # representation.
505 return osutils.safe_revision_id(self.spec, warn=False)469 if isinstance(self.spec, unicode):
470 return cache_utf8.encode(self.spec)
471 return self.spec
506472
507473
508474
@@ -986,9 +952,6 @@
986# The order in which we want to DWIM a revision spec without any prefix.952# The order in which we want to DWIM a revision spec without any prefix.
987# revno is always tried first and isn't listed here, this is used by953# revno is always tried first and isn't listed here, this is used by
988# RevisionSpec_dwim._match_on954# RevisionSpec_dwim._match_on
989dwim_revspecs = symbol_versioning.deprecated_list(
990 symbol_versioning.deprecated_in((2, 4, 0)), "dwim_revspecs", [])
991
992RevisionSpec_dwim.append_possible_revspec(RevisionSpec_tag)955RevisionSpec_dwim.append_possible_revspec(RevisionSpec_tag)
993RevisionSpec_dwim.append_possible_revspec(RevisionSpec_revid)956RevisionSpec_dwim.append_possible_revspec(RevisionSpec_revid)
994RevisionSpec_dwim.append_possible_revspec(RevisionSpec_date)957RevisionSpec_dwim.append_possible_revspec(RevisionSpec_date)
995958
=== modified file 'breezy/tag.py'
--- breezy/tag.py 2017-05-22 00:56:52 +0000
+++ breezy/tag.py 2017-05-30 21:16:02 +0000
@@ -38,7 +38,6 @@
38 bencode,38 bencode,
39 cleanup,39 cleanup,
40 errors,40 errors,
41 symbol_versioning,
42 trace,41 trace,
43 )42 )
44""")43""")
@@ -356,31 +355,6 @@
356 return result, updates, conflicts355 return result, updates, conflicts
357356
358357
359def _merge_tags_if_possible(from_branch, to_branch, ignore_master=False):
360 # Try hard to support merge_to implementations that don't expect
361 # 'ignore_master' (new in bzr 2.3). First, if the flag isn't set then we
362 # can safely avoid passing ignore_master at all.
363 if not ignore_master:
364 from_branch.tags.merge_to(to_branch.tags)
365 return
366 # If the flag is set, try to pass it, but be ready to catch TypeError.
367 try:
368 from_branch.tags.merge_to(to_branch.tags, ignore_master=ignore_master)
369 except TypeError:
370 # Probably this implementation of 'merge_to' is from a plugin that
371 # doesn't expect the 'ignore_master' keyword argument (e.g. bzr-svn
372 # 1.0.4). There's a small risk that the TypeError is actually caused
373 # by a completely different problem (which is why we don't catch it for
374 # the ignore_master=False case), but even then there's probably no harm
375 # in calling a second time.
376 symbol_versioning.warn(
377 symbol_versioning.deprecated_in((2,3)) % (
378 "Tags.merge_to (of %r) that doesn't accept ignore_master kwarg"
379 % (from_branch.tags,),),
380 DeprecationWarning)
381 from_branch.tags.merge_to(to_branch.tags)
382
383
384def sort_natural(branch, tags):358def sort_natural(branch, tags):
385 """Sort tags, with numeric substrings as numbers.359 """Sort tags, with numeric substrings as numbers.
386360
387361
=== modified file 'breezy/tests/__init__.py'
--- breezy/tests/__init__.py 2017-05-24 16:33:08 +0000
+++ breezy/tests/__init__.py 2017-05-30 21:16:02 +0000
@@ -93,19 +93,10 @@
93 text_type,93 text_type,
94 )94 )
95from ..smart import client, request95from ..smart import client, request
96from ..symbol_versioning import (
97 deprecated_function,
98 deprecated_in,
99 deprecated_method,
100 )
101from ..transport import (96from ..transport import (
102 memory,97 memory,
103 pathfilter,98 pathfilter,
104 )99 )
105from ..symbol_versioning import (
106 deprecated_function,
107 deprecated_in,
108 )
109from ..tests import (100from ..tests import (
110 fixtures,101 fixtures,
111 test_server,102 test_server,
@@ -899,7 +890,8 @@
899890
900class StringIOWrapper(ui_testing.BytesIOWithEncoding):891class StringIOWrapper(ui_testing.BytesIOWithEncoding):
901892
902 @deprecated_method(deprecated_in((3, 0)))893 @symbol_versioning.deprecated_method(
894 symbol_versioning.deprecated_in((3, 0)))
903 def __init__(self, s=None):895 def __init__(self, s=None):
904 super(StringIOWrapper, self).__init__(s)896 super(StringIOWrapper, self).__init__(s)
905897
@@ -1556,10 +1548,6 @@
1556 else:1548 else:
1557 self.assertEqual(expected_docstring, obj.__doc__)1549 self.assertEqual(expected_docstring, obj.__doc__)
15581550
1559 @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
1560 def failUnlessExists(self, path):
1561 return self.assertPathExists(path)
1562
1563 def assertPathExists(self, path):1551 def assertPathExists(self, path):
1564 """Fail unless path or paths, which may be abs or relative, exist."""1552 """Fail unless path or paths, which may be abs or relative, exist."""
1565 if not isinstance(path, basestring):1553 if not isinstance(path, basestring):
@@ -1569,10 +1557,6 @@
1569 self.assertTrue(osutils.lexists(path),1557 self.assertTrue(osutils.lexists(path),
1570 path + " does not exist")1558 path + " does not exist")
15711559
1572 @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
1573 def failIfExists(self, path):
1574 return self.assertPathDoesNotExist(path)
1575
1576 def assertPathDoesNotExist(self, path):1560 def assertPathDoesNotExist(self, path):
1577 """Fail if path or paths, which may be abs or relative, exist."""1561 """Fail if path or paths, which may be abs or relative, exist."""
1578 if not isinstance(path, basestring):1562 if not isinstance(path, basestring):
@@ -4468,30 +4452,3 @@
4468 return result4452 return result
4469except ImportError:4453except ImportError:
4470 pass4454 pass
4471
4472
4473# API compatibility for old plugins; see bug 892622.
4474for name in [
4475 'Feature',
4476 'HTTPServerFeature',
4477 'ModuleAvailableFeature',
4478 'HTTPSServerFeature', 'SymlinkFeature', 'HardlinkFeature',
4479 'OsFifoFeature', 'UnicodeFilenameFeature',
4480 'ByteStringNamedFilesystem', 'UTF8Filesystem',
4481 'BreakinFeature', 'CaseInsCasePresFilenameFeature',
4482 'CaseInsensitiveFilesystemFeature', 'case_sensitive_filesystem_feature',
4483 'posix_permissions_feature',
4484 ]:
4485 globals()[name] = _CompatabilityThunkFeature(
4486 symbol_versioning.deprecated_in((2, 5, 0)),
4487 'breezy.tests', name,
4488 name, 'breezy.tests.features')
4489
4490
4491for (old_name, new_name) in [
4492 ('UnicodeFilename', 'UnicodeFilenameFeature'),
4493 ]:
4494 globals()[name] = _CompatabilityThunkFeature(
4495 symbol_versioning.deprecated_in((2, 5, 0)),
4496 'breezy.tests', old_name,
4497 new_name, 'breezy.tests.features')
44984455
=== modified file 'breezy/tests/blackbox/__init__.py'
--- breezy/tests/blackbox/__init__.py 2017-05-23 14:08:03 +0000
+++ breezy/tests/blackbox/__init__.py 2017-05-30 21:16:02 +0000
@@ -23,10 +23,6 @@
23"""23"""
2424
2525
26from breezy.symbol_versioning import (
27 deprecated_in,
28 deprecated_method,
29 )
30from breezy import tests26from breezy import tests
3127
3228
@@ -144,11 +140,3 @@
144class ExternalBase(tests.TestCaseWithTransport):140class ExternalBase(tests.TestCaseWithTransport):
145 """Don't use this class anymore, use TestCaseWithTransport or similar"""141 """Don't use this class anymore, use TestCaseWithTransport or similar"""
146142
147 @deprecated_method(deprecated_in((2, 2, 0)))
148 def check_output(self, output, *args):
149 """Verify that the expected output matches what brz says.
150
151 The output is supplied first, so that you can supply a variable
152 number of arguments to bzr.
153 """
154 self.assertEqual(self.run_bzr(*args)[0], output)
155143
=== modified file 'breezy/tests/blackbox/test_log.py'
--- breezy/tests/blackbox/test_log.py 2017-05-24 16:33:08 +0000
+++ breezy/tests/blackbox/test_log.py 2017-05-30 21:16:02 +0000
@@ -562,24 +562,6 @@
562 self.assertLogRevnos(['-n0'], ['2', '1.1.2', '1.2.1', '1.1.1', '1'],562 self.assertLogRevnos(['-n0'], ['2', '1.1.2', '1.2.1', '1.1.1', '1'],
563 working_dir='level0')563 working_dir='level0')
564564
565 def test_include_merges(self):
566 # Confirm --include-merges gives the same output as -n0
567 msg = ("The option '--include-merges' to 'brz log' "
568 "has been deprecated in brz 2.5. "
569 "Please use '--include-merged' instead.\n")
570 self.assertLogRevnos(['--include-merges'],
571 ['2', '1.1.2', '1.2.1', '1.1.1', '1'],
572 working_dir='level0', err=msg)
573 self.assertLogRevnos(['--include-merges'],
574 ['2', '1.1.2', '1.2.1', '1.1.1', '1'],
575 working_dir='level0', err=msg)
576 out_im, err_im = self.run_bzr('log --include-merges',
577 working_dir='level0')
578 out_n0, err_n0 = self.run_bzr('log -n0', working_dir='level0')
579 self.assertEqual(msg, err_im)
580 self.assertEqual('', err_n0)
581 self.assertEqual(out_im, out_n0)
582
583 def test_include_merged(self):565 def test_include_merged(self):
584 # Confirm --include-merged gives the same output as -n0566 # Confirm --include-merged gives the same output as -n0
585 expected = ['2', '1.1.2', '1.2.1', '1.1.1', '1']567 expected = ['2', '1.1.2', '1.2.1', '1.1.1', '1']
586568
=== modified file 'breezy/tests/per_branch/test_branch.py'
--- breezy/tests/per_branch/test_branch.py 2017-05-21 18:10:28 +0000
+++ breezy/tests/per_branch/test_branch.py 2017-05-30 21:16:02 +0000
@@ -33,7 +33,6 @@
33 repository,33 repository,
34 revision,34 revision,
35 shelf,35 shelf,
36 symbol_versioning,
37 tests,36 tests,
38 )37 )
39from breezy.tests import (38from breezy.tests import (
@@ -107,24 +106,6 @@
107 self.addCleanup(tree.unlock)106 self.addCleanup(tree.unlock)
108 self.assertEqual(tree.get_file_text('foo-id'), 'hello')107 self.assertEqual(tree.get_file_text('foo-id'), 'hello')
109108
110 def test_get_revision_delta(self):
111 tree_a = self.make_branch_and_tree('a')
112 self.build_tree(['a/foo'])
113 tree_a.add('foo', 'file1')
114 tree_a.commit('rev1', rev_id='rev1')
115 self.build_tree(['a/vla'])
116 tree_a.add('vla', 'file2')
117 tree_a.commit('rev2', rev_id='rev2')
118
119 delta = self.applyDeprecated(symbol_versioning.deprecated_in(
120 (2, 5, 0)), tree_a.branch.get_revision_delta, 1)
121 self.assertIsInstance(delta, _mod_delta.TreeDelta)
122 self.assertEqual([('foo', 'file1', 'file')], delta.added)
123 delta = self.applyDeprecated(symbol_versioning.deprecated_in(
124 (2, 5, 0)), tree_a.branch.get_revision_delta, 2)
125 self.assertIsInstance(delta, _mod_delta.TreeDelta)
126 self.assertEqual([('vla', 'file2', 'file')], delta.added)
127
128 def get_unbalanced_tree_pair(self):109 def get_unbalanced_tree_pair(self):
129 """Return two branches, a and b, with one file in a."""110 """Return two branches, a and b, with one file in a."""
130 tree_a = self.make_branch_and_tree('a')111 tree_a = self.make_branch_and_tree('a')
131112
=== modified file 'breezy/tests/per_branch/test_check.py'
--- breezy/tests/per_branch/test_check.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_branch/test_check.py 2017-05-30 21:16:02 +0000
@@ -25,7 +25,6 @@
25from ...sixish import (25from ...sixish import (
26 BytesIO,26 BytesIO,
27 )27 )
28from ...symbol_versioning import deprecated_in
29from . import TestCaseWithBranch28from . import TestCaseWithBranch
3029
3130
3231
=== modified file 'breezy/tests/per_branch/test_get_revision_id_to_revno_map.py'
--- breezy/tests/per_branch/test_get_revision_id_to_revno_map.py 2017-05-21 18:10:28 +0000
+++ breezy/tests/per_branch/test_get_revision_id_to_revno_map.py 2017-05-30 21:16:02 +0000
@@ -16,7 +16,6 @@
1616
17"""Tests for Branch.get_revision_id_to_revno_map()"""17"""Tests for Branch.get_revision_id_to_revno_map()"""
1818
19from breezy.symbol_versioning import deprecated_in
20from breezy.tests.per_branch import TestCaseWithBranch19from breezy.tests.per_branch import TestCaseWithBranch
2120
2221
2322
=== modified file 'breezy/tests/per_branch/test_hooks.py'
--- breezy/tests/per_branch/test_hooks.py 2017-05-21 18:10:28 +0000
+++ breezy/tests/per_branch/test_hooks.py 2017-05-30 21:16:02 +0000
@@ -23,7 +23,6 @@
23 revision,23 revision,
24 tests,24 tests,
25 )25 )
26from breezy.symbol_versioning import deprecated_in
27from breezy.tests import test_server26from breezy.tests import test_server
2827
29class ChangeBranchTipTestCase(tests.TestCaseWithMemoryTransport):28class ChangeBranchTipTestCase(tests.TestCaseWithMemoryTransport):
3029
=== modified file 'breezy/tests/per_branch/test_push.py'
--- breezy/tests/per_branch/test_push.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_branch/test_push.py 2017-05-30 21:16:02 +0000
@@ -27,7 +27,6 @@
27 memorytree,27 memorytree,
28 push,28 push,
29 revision,29 revision,
30 symbol_versioning,
31 tests,30 tests,
32 transport,31 transport,
33 )32 )
3433
=== modified file 'breezy/tests/per_interbranch/test_push.py'
--- breezy/tests/per_interbranch/test_push.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_interbranch/test_push.py 2017-05-30 21:16:02 +0000
@@ -27,7 +27,6 @@
27 controldir,27 controldir,
28 errors,28 errors,
29 push,29 push,
30 symbol_versioning,
31 tests,30 tests,
32 vf_repository,31 vf_repository,
33 )32 )
3433
=== modified file 'breezy/tests/per_interrepository/test_interrepository.py'
--- breezy/tests/per_interrepository/test_interrepository.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_interrepository/test_interrepository.py 2017-05-30 21:16:02 +0000
@@ -112,12 +112,6 @@
112 self.assertRaises(errors.NoSuchRevision,112 self.assertRaises(errors.NoSuchRevision,
113 repo_b.search_missing_revision_ids, repo_a, revision_ids=['pizza'],113 repo_b.search_missing_revision_ids, repo_a, revision_ids=['pizza'],
114 find_ghosts=False)114 find_ghosts=False)
115 self.callDeprecated(
116 ['search_missing_revision_ids(revision_id=...) was deprecated in '
117 '2.4. Use revision_ids=[...] instead.'],
118 self.assertRaises, errors.NoSuchRevision,
119 repo_b.search_missing_revision_ids, repo_a, revision_id='pizza',
120 find_ghosts=False)
121115
122 def test_search_missing_revision_ids_revision_limited(self):116 def test_search_missing_revision_ids_revision_limited(self):
123 # revision ids in repository A that are not referenced by the117 # revision ids in repository A that are not referenced by the
124118
=== modified file 'breezy/tests/per_inventory/basics.py'
--- breezy/tests/per_inventory/basics.py 2017-05-21 18:10:28 +0000
+++ breezy/tests/per_inventory/basics.py 2017-05-30 21:16:02 +0000
@@ -35,10 +35,6 @@
3535
36from breezy.tests.per_inventory import TestCaseWithInventory36from breezy.tests.per_inventory import TestCaseWithInventory
3737
38from breezy.symbol_versioning import (
39 deprecated_in,
40 )
41
4238
43class TestInventory(TestCaseWithInventory):39class TestInventory(TestCaseWithInventory):
4440
4541
=== modified file 'breezy/tests/per_repository/test_repository.py'
--- breezy/tests/per_repository/test_repository.py 2017-05-24 16:21:50 +0000
+++ breezy/tests/per_repository/test_repository.py 2017-05-30 21:16:02 +0000
@@ -258,14 +258,7 @@
258 list(tree.list_files(include_root=True)))258 list(tree.list_files(include_root=True)))
259 finally:259 finally:
260 tree.unlock()260 tree.unlock()
261 tree = self.callDeprecated(['NULL_REVISION should be used for the null'261 self.assertRaises(ValueError, wt.branch.repository.revision_tree, None)
262 ' revision instead of None, as of bzr 0.91.'],
263 wt.branch.repository.revision_tree, None)
264 tree.lock_read()
265 try:
266 self.assertEqual([], list(tree.list_files(include_root=True)))
267 finally:
268 tree.unlock()
269 tree = wt.branch.repository.revision_tree(_mod_revision.NULL_REVISION)262 tree = wt.branch.repository.revision_tree(_mod_revision.NULL_REVISION)
270 tree.lock_read()263 tree.lock_read()
271 try:264 try:
272265
=== modified file 'breezy/tests/per_repository_vf/test_repository.py'
--- breezy/tests/per_repository_vf/test_repository.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_repository_vf/test_repository.py 2017-05-30 21:16:02 +0000
@@ -27,7 +27,6 @@
27 vf_repository,27 vf_repository,
28 )28 )
2929
30from breezy.symbol_versioning import deprecated_in
31from breezy.tests.matchers import MatchesAncestry30from breezy.tests.matchers import MatchesAncestry
32from breezy.tests.per_repository_vf import (31from breezy.tests.per_repository_vf import (
33 TestCaseWithRepository,32 TestCaseWithRepository,
3433
=== modified file 'breezy/tests/per_tree/test_tree.py'
--- breezy/tests/per_tree/test_tree.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_tree/test_tree.py 2017-05-30 21:16:02 +0000
@@ -24,9 +24,6 @@
24 )24 )
25from breezy.tests import TestSkipped25from breezy.tests import TestSkipped
26from breezy.tests.per_tree import TestCaseWithTree26from breezy.tests.per_tree import TestCaseWithTree
27from breezy.symbol_versioning import (
28 deprecated_in,
29 )
3027
3128
32class TestAnnotate(TestCaseWithTree):29class TestAnnotate(TestCaseWithTree):
@@ -284,22 +281,6 @@
284 self.assertTrue(tree.has_id('file-id'))281 self.assertTrue(tree.has_id('file-id'))
285 self.assertFalse(tree.has_id('dir-id'))282 self.assertFalse(tree.has_id('dir-id'))
286283
287 def test___contains__(self):
288 work_tree = self.make_branch_and_tree('tree')
289 self.build_tree(['tree/file'])
290 work_tree.add('file', 'file-id')
291 tree = self._convert_tree(work_tree)
292 tree.lock_read()
293 self.addCleanup(tree.unlock)
294 self.assertTrue(
295 self.applyDeprecated(
296 deprecated_in((2, 4, 0)),
297 tree.__contains__, 'file-id'))
298 self.assertFalse(
299 self.applyDeprecated(
300 deprecated_in((2, 4, 0)),
301 tree.__contains__, 'dir-id'))
302
303284
304class TestExtras(TestCaseWithTree):285class TestExtras(TestCaseWithTree):
305286
306287
=== modified file 'breezy/tests/per_workingtree/test_workingtree.py'
--- breezy/tests/per_workingtree/test_workingtree.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/per_workingtree/test_workingtree.py 2017-05-30 21:16:02 +0000
@@ -27,7 +27,6 @@
27 errors,27 errors,
28 osutils,28 osutils,
29 revision as _mod_revision,29 revision as _mod_revision,
30 symbol_versioning,
31 tests,30 tests,
32 trace,31 trace,
33 urlutils,32 urlutils,
3433
=== modified file 'breezy/tests/test_annotate.py'
--- breezy/tests/test_annotate.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_annotate.py 2017-05-30 21:16:02 +0000
@@ -20,7 +20,6 @@
2020
21from .. import (21from .. import (
22 annotate,22 annotate,
23 symbol_versioning,
24 tests,23 tests,
25 )24 )
26from ..sixish import (25from ..sixish import (
2726
=== modified file 'breezy/tests/test_atomicfile.py'
--- breezy/tests/test_atomicfile.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_atomicfile.py 2017-05-30 21:16:02 +0000
@@ -24,7 +24,6 @@
24 atomicfile,24 atomicfile,
25 errors,25 errors,
26 osutils,26 osutils,
27 symbol_versioning,
28 )27 )
29from . import TestCaseInTempDir, TestSkipped28from . import TestCaseInTempDir, TestSkipped
3029
3130
=== modified file 'breezy/tests/test_commit.py'
--- breezy/tests/test_commit.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_commit.py 2017-05-30 21:16:02 +0000
@@ -790,13 +790,13 @@
790 self.assertFalse('authors' in rev.properties)790 self.assertFalse('authors' in rev.properties)
791791
792 def test_commit_author(self):792 def test_commit_author(self):
793 """Passing a non-empty author kwarg to MutableTree.commit should add793 """Passing a non-empty authors kwarg to MutableTree.commit should add
794 the 'author' revision property.794 the 'author' revision property.
795 """795 """
796 tree = self.make_branch_and_tree('foo')796 tree = self.make_branch_and_tree('foo')
797 rev_id = self.callDeprecated(['The parameter author was '797 rev_id = tree.commit(
798 'deprecated in version 1.13. Use authors instead'],798 'commit 1',
799 tree.commit, 'commit 1', author='John Doe <jdoe@example.com>')799 authors=['John Doe <jdoe@example.com>'])
800 rev = tree.branch.repository.get_revision(rev_id)800 rev = tree.branch.repository.get_revision(rev_id)
801 self.assertEqual('John Doe <jdoe@example.com>',801 self.assertEqual('John Doe <jdoe@example.com>',
802 rev.properties['authors'])802 rev.properties['authors'])
@@ -820,13 +820,6 @@
820 'Jane Rey <jrey@example.com>', rev.properties['authors'])820 'Jane Rey <jrey@example.com>', rev.properties['authors'])
821 self.assertFalse('author' in rev.properties)821 self.assertFalse('author' in rev.properties)
822822
823 def test_author_and_authors_incompatible(self):
824 tree = self.make_branch_and_tree('foo')
825 self.assertRaises(AssertionError, tree.commit, 'commit 1',
826 authors=['John Doe <jdoe@example.com>',
827 'Jane Rey <jrey@example.com>'],
828 author="Jack Me <jme@example.com>")
829
830 def test_author_with_newline_rejected(self):823 def test_author_with_newline_rejected(self):
831 tree = self.make_branch_and_tree('foo')824 tree = self.make_branch_and_tree('foo')
832 self.assertRaises(AssertionError, tree.commit, 'commit 1',825 self.assertRaises(AssertionError, tree.commit, 'commit 1',
833826
=== modified file 'breezy/tests/test_config.py'
--- breezy/tests/test_config.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_config.py 2017-05-30 21:16:02 +0000
@@ -42,9 +42,6 @@
42from ..sixish import (42from ..sixish import (
43 BytesIO,43 BytesIO,
44 )44 )
45from ..symbol_versioning import (
46 deprecated_in,
47 )
48from ..transport import remote as transport_remote45from ..transport import remote as transport_remote
49from . import (46from . import (
50 features,47 features,
@@ -488,60 +485,10 @@
488 my_config.username())485 my_config.username())
489 self.assertEqual(['_get_user_id'], my_config._calls)486 self.assertEqual(['_get_user_id'], my_config._calls)
490487
491 def test_signatures_default(self):
492 my_config = config.Config()
493 self.assertFalse(
494 self.applyDeprecated(deprecated_in((2, 5, 0)),
495 my_config.signature_needed))
496 self.assertEqual(config.CHECK_IF_POSSIBLE,
497 self.applyDeprecated(deprecated_in((2, 5, 0)),
498 my_config.signature_checking))
499 self.assertEqual(config.SIGN_WHEN_REQUIRED,
500 self.applyDeprecated(deprecated_in((2, 5, 0)),
501 my_config.signing_policy))
502
503 def test_signatures_template_method(self):
504 my_config = InstrumentedConfig()
505 self.assertEqual(config.CHECK_NEVER,
506 self.applyDeprecated(deprecated_in((2, 5, 0)),
507 my_config.signature_checking))
508 self.assertEqual(['_get_signature_checking'], my_config._calls)
509
510 def test_signatures_template_method_none(self):
511 my_config = InstrumentedConfig()
512 my_config._signatures = None
513 self.assertEqual(config.CHECK_IF_POSSIBLE,
514 self.applyDeprecated(deprecated_in((2, 5, 0)),
515 my_config.signature_checking))
516 self.assertEqual(['_get_signature_checking'], my_config._calls)
517
518 def test_gpg_signing_command_default(self):
519 my_config = config.Config()
520 self.assertEqual('gpg',
521 self.applyDeprecated(deprecated_in((2, 5, 0)),
522 my_config.gpg_signing_command))
523
524 def test_get_user_option_default(self):488 def test_get_user_option_default(self):
525 my_config = config.Config()489 my_config = config.Config()
526 self.assertEqual(None, my_config.get_user_option('no_option'))490 self.assertEqual(None, my_config.get_user_option('no_option'))
527491
528 def test_post_commit_default(self):
529 my_config = config.Config()
530 self.assertEqual(None, self.applyDeprecated(deprecated_in((2, 5, 0)),
531 my_config.post_commit))
532
533
534 def test_log_format_default(self):
535 my_config = config.Config()
536 self.assertEqual('long',
537 self.applyDeprecated(deprecated_in((2, 5, 0)),
538 my_config.log_format))
539
540 def test_acceptable_keys_default(self):
541 my_config = config.Config()
542 self.assertEqual(None, self.applyDeprecated(deprecated_in((2, 5, 0)),
543 my_config.acceptable_keys))
544
545 def test_validate_signatures_in_log_default(self):492 def test_validate_signatures_in_log_default(self):
546 my_config = config.Config()493 my_config = config.Config()
547 self.assertEqual(False, my_config.validate_signatures_in_log())494 self.assertEqual(False, my_config.validate_signatures_in_log())
@@ -656,21 +603,6 @@
656 self.assertTrue(isinstance(self.uid, int))603 self.assertTrue(isinstance(self.uid, int))
657 self.assertTrue(isinstance(self.gid, int))604 self.assertTrue(isinstance(self.gid, int))
658605
659 def test_get_filename_parameter_is_deprecated_(self):
660 conf = self.callDeprecated([
661 'IniBasedConfig.__init__(get_filename) was deprecated in 2.3.'
662 ' Use file_name instead.'],
663 config.IniBasedConfig, lambda: 'ini.conf')
664 self.assertEqual('ini.conf', conf.file_name)
665
666 def test_get_parser_file_parameter_is_deprecated_(self):
667 config_file = BytesIO(sample_config_text.encode('utf-8'))
668 conf = config.IniBasedConfig.from_string(sample_config_text)
669 conf = self.callDeprecated([
670 'IniBasedConfig._get_parser(file=xxx) was deprecated in 2.3.'
671 ' Use IniBasedConfig(_content=xxx) instead.'],
672 conf._get_parser, file=config_file)
673
674606
675class TestIniConfigSaving(tests.TestCaseInTempDir):607class TestIniConfigSaving(tests.TestCaseInTempDir):
676608
@@ -1004,30 +936,6 @@
1004 # automatically cast to list936 # automatically cast to list
1005 self.assertEqual(['x'], get_list('one_item'))937 self.assertEqual(['x'], get_list('one_item'))
1006938
1007 def test_get_user_option_as_int_from_SI(self):
1008 conf, parser = self.make_config_parser("""
1009plain = 100
1010si_k = 5k,
1011si_kb = 5kb,
1012si_m = 5M,
1013si_mb = 5MB,
1014si_g = 5g,
1015si_gb = 5gB,
1016""")
1017 def get_si(s, default=None):
1018 return self.applyDeprecated(
1019 deprecated_in((2, 5, 0)),
1020 conf.get_user_option_as_int_from_SI, s, default)
1021 self.assertEqual(100, get_si('plain'))
1022 self.assertEqual(5000, get_si('si_k'))
1023 self.assertEqual(5000, get_si('si_kb'))
1024 self.assertEqual(5000000, get_si('si_m'))
1025 self.assertEqual(5000000, get_si('si_mb'))
1026 self.assertEqual(5000000000, get_si('si_g'))
1027 self.assertEqual(5000000000, get_si('si_gb'))
1028 self.assertEqual(None, get_si('non-exist'))
1029 self.assertEqual(42, get_si('non-exist-with-default', 42))
1030
1031939
1032class TestSupressWarning(TestIniConfig):940class TestSupressWarning(TestIniConfig):
1033941
@@ -1181,6 +1089,14 @@
11811089
1182class TestGlobalConfigItems(tests.TestCaseInTempDir):1090class TestGlobalConfigItems(tests.TestCaseInTempDir):
11831091
1092 def _get_empty_config(self):
1093 my_config = config.GlobalConfig()
1094 return my_config
1095
1096 def _get_sample_config(self):
1097 my_config = config.GlobalConfig.from_string(sample_config_text)
1098 return my_config
1099
1184 def test_user_id(self):1100 def test_user_id(self):
1185 my_config = config.GlobalConfig.from_string(sample_config_text)1101 my_config = config.GlobalConfig.from_string(sample_config_text)
1186 self.assertEqual(u"Erik B\u00e5gfors <erik@bagfors.nu>",1102 self.assertEqual(u"Erik B\u00e5gfors <erik@bagfors.nu>",
@@ -1190,68 +1106,6 @@
1190 my_config = config.GlobalConfig()1106 my_config = config.GlobalConfig()
1191 self.assertEqual(None, my_config._get_user_id())1107 self.assertEqual(None, my_config._get_user_id())
11921108
1193 def test_signatures_always(self):
1194 my_config = config.GlobalConfig.from_string(sample_always_signatures)
1195 self.assertEqual(config.CHECK_NEVER,
1196 self.applyDeprecated(deprecated_in((2, 5, 0)),
1197 my_config.signature_checking))
1198 self.assertEqual(config.SIGN_ALWAYS,
1199 self.applyDeprecated(deprecated_in((2, 5, 0)),
1200 my_config.signing_policy))
1201 self.assertEqual(True,
1202 self.applyDeprecated(deprecated_in((2, 5, 0)),
1203 my_config.signature_needed))
1204
1205 def test_signatures_if_possible(self):
1206 my_config = config.GlobalConfig.from_string(sample_maybe_signatures)
1207 self.assertEqual(config.CHECK_NEVER,
1208 self.applyDeprecated(deprecated_in((2, 5, 0)),
1209 my_config.signature_checking))
1210 self.assertEqual(config.SIGN_WHEN_REQUIRED,
1211 self.applyDeprecated(deprecated_in((2, 5, 0)),
1212 my_config.signing_policy))
1213 self.assertEqual(False, self.applyDeprecated(deprecated_in((2, 5, 0)),
1214 my_config.signature_needed))
1215
1216 def test_signatures_ignore(self):
1217 my_config = config.GlobalConfig.from_string(sample_ignore_signatures)
1218 self.assertEqual(config.CHECK_ALWAYS,
1219 self.applyDeprecated(deprecated_in((2, 5, 0)),
1220 my_config.signature_checking))
1221 self.assertEqual(config.SIGN_NEVER,
1222 self.applyDeprecated(deprecated_in((2, 5, 0)),
1223 my_config.signing_policy))
1224 self.assertEqual(False, self.applyDeprecated(deprecated_in((2, 5, 0)),
1225 my_config.signature_needed))
1226
1227 def _get_sample_config(self):
1228 my_config = config.GlobalConfig.from_string(sample_config_text)
1229 return my_config
1230
1231 def test_gpg_signing_command(self):
1232 my_config = self._get_sample_config()
1233 self.assertEqual("gnome-gpg",
1234 self.applyDeprecated(
1235 deprecated_in((2, 5, 0)), my_config.gpg_signing_command))
1236 self.assertEqual(False, self.applyDeprecated(deprecated_in((2, 5, 0)),
1237 my_config.signature_needed))
1238
1239 def test_gpg_signing_key(self):
1240 my_config = self._get_sample_config()
1241 self.assertEqual("DD4D5088",
1242 self.applyDeprecated(deprecated_in((2, 5, 0)),
1243 my_config.gpg_signing_key))
1244
1245 def _get_empty_config(self):
1246 my_config = config.GlobalConfig()
1247 return my_config
1248
1249 def test_gpg_signing_command_unset(self):
1250 my_config = self._get_empty_config()
1251 self.assertEqual("gpg",
1252 self.applyDeprecated(
1253 deprecated_in((2, 5, 0)), my_config.gpg_signing_command))
1254
1255 def test_get_user_option_default(self):1109 def test_get_user_option_default(self):
1256 my_config = self._get_empty_config()1110 my_config = self._get_empty_config()
1257 self.assertEqual(None, my_config.get_user_option('no_option'))1111 self.assertEqual(None, my_config.get_user_option('no_option'))
@@ -1261,24 +1115,6 @@
1261 self.assertEqual("something",1115 self.assertEqual("something",
1262 my_config.get_user_option('user_global_option'))1116 my_config.get_user_option('user_global_option'))
12631117
1264 def test_post_commit_default(self):
1265 my_config = self._get_sample_config()
1266 self.assertEqual(None,
1267 self.applyDeprecated(deprecated_in((2, 5, 0)),
1268 my_config.post_commit))
1269
1270 def test_configured_logformat(self):
1271 my_config = self._get_sample_config()
1272 self.assertEqual("short",
1273 self.applyDeprecated(deprecated_in((2, 5, 0)),
1274 my_config.log_format))
1275
1276 def test_configured_acceptable_keys(self):
1277 my_config = self._get_sample_config()
1278 self.assertEqual("amy",
1279 self.applyDeprecated(deprecated_in((2, 5, 0)),
1280 my_config.acceptable_keys))
1281
1282 def test_configured_validate_signatures_in_log(self):1118 def test_configured_validate_signatures_in_log(self):
1283 my_config = self._get_sample_config()1119 my_config = self._get_sample_config()
1284 self.assertEqual(True, my_config.validate_signatures_in_log())1120 self.assertEqual(True, my_config.validate_signatures_in_log())
@@ -1517,57 +1353,6 @@
1517 self.assertEqual('Robert Collins <robertc@example.org>',1353 self.assertEqual('Robert Collins <robertc@example.org>',
1518 self.my_config.username())1354 self.my_config.username())
15191355
1520 def test_signatures_not_set(self):
1521 self.get_branch_config('http://www.example.com',
1522 global_config=sample_ignore_signatures)
1523 self.assertEqual(config.CHECK_ALWAYS,
1524 self.applyDeprecated(deprecated_in((2, 5, 0)),
1525 self.my_config.signature_checking))
1526 self.assertEqual(config.SIGN_NEVER,
1527 self.applyDeprecated(deprecated_in((2, 5, 0)),
1528 self.my_config.signing_policy))
1529
1530 def test_signatures_never(self):
1531 self.get_branch_config('/a/c')
1532 self.assertEqual(config.CHECK_NEVER,
1533 self.applyDeprecated(deprecated_in((2, 5, 0)),
1534 self.my_config.signature_checking))
1535
1536 def test_signatures_when_available(self):
1537 self.get_branch_config('/a/', global_config=sample_ignore_signatures)
1538 self.assertEqual(config.CHECK_IF_POSSIBLE,
1539 self.applyDeprecated(deprecated_in((2, 5, 0)),
1540 self.my_config.signature_checking))
1541
1542 def test_signatures_always(self):
1543 self.get_branch_config('/b')
1544 self.assertEqual(config.CHECK_ALWAYS,
1545 self.applyDeprecated(deprecated_in((2, 5, 0)),
1546 self.my_config.signature_checking))
1547
1548 def test_gpg_signing_command(self):
1549 self.get_branch_config('/b')
1550 self.assertEqual("gnome-gpg",
1551 self.applyDeprecated(deprecated_in((2, 5, 0)),
1552 self.my_config.gpg_signing_command))
1553
1554 def test_gpg_signing_command_missing(self):
1555 self.get_branch_config('/a')
1556 self.assertEqual("false",
1557 self.applyDeprecated(deprecated_in((2, 5, 0)),
1558 self.my_config.gpg_signing_command))
1559
1560 def test_gpg_signing_key(self):
1561 self.get_branch_config('/b')
1562 self.assertEqual("DD4D5088", self.applyDeprecated(deprecated_in((2, 5, 0)),
1563 self.my_config.gpg_signing_key))
1564
1565 def test_gpg_signing_key_default(self):
1566 self.get_branch_config('/a')
1567 self.assertEqual("erik@bagfors.nu",
1568 self.applyDeprecated(deprecated_in((2, 5, 0)),
1569 self.my_config.gpg_signing_key))
1570
1571 def test_get_user_option_global(self):1356 def test_get_user_option_global(self):
1572 self.get_branch_config('/a')1357 self.get_branch_config('/a')
1573 self.assertEqual('something',1358 self.assertEqual('something',
@@ -1637,32 +1422,6 @@
1637 'http://www.example.com', 'norecurse_option'),1422 'http://www.example.com', 'norecurse_option'),
1638 config.POLICY_NONE)1423 config.POLICY_NONE)
16391424
1640 def test_set_user_option_recurse_false_section(self):
1641 # The following section has recurse=False set. The test is to
1642 # make sure that a normal option can be added to the section,
1643 # converting recurse=False to the norecurse policy.
1644 self.get_branch_config('http://www.example.com/norecurse')
1645 self.callDeprecated(['The recurse option is deprecated as of 0.14. '
1646 'The section "http://www.example.com/norecurse" '
1647 'has been converted to use policies.'],
1648 self.my_config.set_user_option,
1649 'foo', 'bar', store=config.STORE_LOCATION)
1650 self.assertEqual(
1651 self.my_location_config._get_option_policy(
1652 'http://www.example.com/norecurse', 'foo'),
1653 config.POLICY_NONE)
1654 # The previously existing option is still norecurse:
1655 self.assertEqual(
1656 self.my_location_config._get_option_policy(
1657 'http://www.example.com/norecurse', 'normal_option'),
1658 config.POLICY_NORECURSE)
1659
1660 def test_post_commit_default(self):
1661 self.get_branch_config('/a/c')
1662 self.assertEqual('breezy.tests.test_config.post_commit',
1663 self.applyDeprecated(deprecated_in((2, 5, 0)),
1664 self.my_config.post_commit))
1665
1666 def get_branch_config(self, location, global_config=None,1425 def get_branch_config(self, location, global_config=None,
1667 location_config=None):1426 location_config=None):
1668 my_branch = FakeBranch(location)1427 my_branch = FakeBranch(location)
@@ -1678,33 +1437,6 @@
1678 self.my_config = my_config1437 self.my_config = my_config
1679 self.my_location_config = my_config._get_location_config()1438 self.my_location_config = my_config._get_location_config()
16801439
1681 def test_set_user_setting_sets_and_saves(self):
1682 self.get_branch_config('/a/c')
1683 record = InstrumentedConfigObj("foo")
1684 self.my_location_config._parser = record
1685
1686 self.callDeprecated(['The recurse option is deprecated as of '
1687 '0.14. The section "/a/c" has been '
1688 'converted to use policies.'],
1689 self.my_config.set_user_option,
1690 'foo', 'bar', store=config.STORE_LOCATION)
1691 self.assertEqual([('reload',),
1692 ('__contains__', '/a/c'),
1693 ('__contains__', '/a/c/'),
1694 ('__setitem__', '/a/c', {}),
1695 ('__getitem__', '/a/c'),
1696 ('__setitem__', 'foo', 'bar'),
1697 ('__getitem__', '/a/c'),
1698 ('as_bool', 'recurse'),
1699 ('__getitem__', '/a/c'),
1700 ('__delitem__', 'recurse'),
1701 ('__getitem__', '/a/c'),
1702 ('keys',),
1703 ('__getitem__', '/a/c'),
1704 ('__contains__', 'foo:policy'),
1705 ('write',)],
1706 record._calls[1:])
1707
1708 def test_set_user_setting_sets_and_saves2(self):1440 def test_set_user_setting_sets_and_saves2(self):
1709 self.get_branch_config('/a/c')1441 self.get_branch_config('/a/c')
1710 self.assertIs(self.my_config.get_user_option('foo'), None)1442 self.assertIs(self.my_config.get_user_option('foo'), None)
@@ -1771,64 +1503,11 @@
1771 self.assertEqual("Robert Collins <robertc@example.org>",1503 self.assertEqual("Robert Collins <robertc@example.org>",
1772 my_config.username())1504 my_config.username())
17731505
1774 def test_signatures_forced(self):
1775 my_config = self.get_branch_config(
1776 global_config=sample_always_signatures)
1777 self.assertEqual(config.CHECK_NEVER,
1778 self.applyDeprecated(deprecated_in((2, 5, 0)),
1779 my_config.signature_checking))
1780 self.assertEqual(config.SIGN_ALWAYS,
1781 self.applyDeprecated(deprecated_in((2, 5, 0)),
1782 my_config.signing_policy))
1783 self.assertTrue(self.applyDeprecated(deprecated_in((2, 5, 0)),
1784 my_config.signature_needed))
1785
1786 def test_signatures_forced_branch(self):
1787 my_config = self.get_branch_config(
1788 global_config=sample_ignore_signatures,
1789 branch_data_config=sample_always_signatures)
1790 self.assertEqual(config.CHECK_NEVER,
1791 self.applyDeprecated(deprecated_in((2, 5, 0)),
1792 my_config.signature_checking))
1793 self.assertEqual(config.SIGN_ALWAYS,
1794 self.applyDeprecated(deprecated_in((2, 5, 0)),
1795 my_config.signing_policy))
1796 self.assertTrue(self.applyDeprecated(deprecated_in((2, 5, 0)),
1797 my_config.signature_needed))
1798
1799 def test_gpg_signing_command(self):
1800 my_config = self.get_branch_config(
1801 global_config=sample_config_text,
1802 # branch data cannot set gpg_signing_command
1803 branch_data_config="gpg_signing_command=pgp")
1804 self.assertEqual('gnome-gpg',
1805 self.applyDeprecated(deprecated_in((2, 5, 0)),
1806 my_config.gpg_signing_command))
1807
1808 def test_get_user_option_global(self):1506 def test_get_user_option_global(self):
1809 my_config = self.get_branch_config(global_config=sample_config_text)1507 my_config = self.get_branch_config(global_config=sample_config_text)
1810 self.assertEqual('something',1508 self.assertEqual('something',
1811 my_config.get_user_option('user_global_option'))1509 my_config.get_user_option('user_global_option'))
18121510
1813 def test_post_commit_default(self):
1814 my_config = self.get_branch_config(global_config=sample_config_text,
1815 location='/a/c',
1816 location_config=sample_branches_text)
1817 self.assertEqual(my_config.branch.base, '/a/c')
1818 self.assertEqual('breezy.tests.test_config.post_commit',
1819 self.applyDeprecated(deprecated_in((2, 5, 0)),
1820 my_config.post_commit))
1821 my_config.set_user_option('post_commit', 'rmtree_root')
1822 # post-commit is ignored when present in branch data
1823 self.assertEqual('breezy.tests.test_config.post_commit',
1824 self.applyDeprecated(deprecated_in((2, 5, 0)),
1825 my_config.post_commit))
1826 my_config.set_user_option('post_commit', 'rmtree_root',
1827 store=config.STORE_LOCATION)
1828 self.assertEqual('rmtree_root',
1829 self.applyDeprecated(deprecated_in((2, 5, 0)),
1830 my_config.post_commit))
1831
1832 def test_config_precedence(self):1511 def test_config_precedence(self):
1833 # FIXME: eager test, luckily no persitent config file makes it fail1512 # FIXME: eager test, luckily no persitent config file makes it fail
1834 # -- vila 201007161513 # -- vila 20100716
18351514
=== modified file 'breezy/tests/test_hooks.py'
--- breezy/tests/test_hooks.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_hooks.py 2017-05-30 21:16:02 +0000
@@ -30,9 +30,6 @@
30 known_hooks,30 known_hooks,
31 known_hooks_key_to_object,31 known_hooks_key_to_object,
32 )32 )
33from ..symbol_versioning import (
34 deprecated_in,
35 )
3633
3734
38class TestHooks(tests.TestCase):35class TestHooks(tests.TestCase):
3936
=== modified file 'breezy/tests/test_lru_cache.py'
--- breezy/tests/test_lru_cache.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_lru_cache.py 2017-05-30 21:16:02 +0000
@@ -18,7 +18,6 @@
1818
19from .. import (19from .. import (
20 lru_cache,20 lru_cache,
21 symbol_versioning,
22 tests,21 tests,
23 )22 )
2423
@@ -128,13 +127,6 @@
128127
129 self.assertFalse('foo' in cache)128 self.assertFalse('foo' in cache)
130129
131 def test_cleanup_function_deprecated(self):
132 """Test that per-node cleanup functions are no longer allowed"""
133 cache = lru_cache.LRUCache()
134 self.assertRaises(ValueError, self.applyDeprecated,
135 symbol_versioning.deprecated_in((2, 5, 0)),
136 cache.add, "key", 1, cleanup=lambda: None)
137
138 def test_len(self):130 def test_len(self):
139 cache = lru_cache.LRUCache(max_cache=10, after_cleanup_count=10)131 cache = lru_cache.LRUCache(max_cache=10, after_cleanup_count=10)
140132
141133
=== modified file 'breezy/tests/test_osutils.py'
--- breezy/tests/test_osutils.py 2017-05-24 22:42:07 +0000
+++ breezy/tests/test_osutils.py 2017-05-30 21:16:02 +0000
@@ -829,17 +829,12 @@
829 self.assertEqual('foobar', osutils.safe_revision_id('foobar'))829 self.assertEqual('foobar', osutils.safe_revision_id('foobar'))
830830
831 def test_from_unicode_string_ascii_contents(self):831 def test_from_unicode_string_ascii_contents(self):
832 self.assertEqual('bargam',832 self.assertRaises(TypeError,
833 osutils.safe_revision_id(u'bargam', warn=False))833 osutils.safe_revision_id, u'bargam')
834
835 def test_from_unicode_deprecated(self):
836 self.assertEqual('bargam',
837 self.callDeprecated([osutils._revision_id_warning],
838 osutils.safe_revision_id, u'bargam'))
839834
840 def test_from_unicode_string_unicode_contents(self):835 def test_from_unicode_string_unicode_contents(self):
841 self.assertEqual('bargam\xc2\xae',836 self.assertRaises(TypeError,
842 osutils.safe_revision_id(u'bargam\xae', warn=False))837 osutils.safe_revision_id, u'bargam\xae')
843838
844 def test_from_utf8_string(self):839 def test_from_utf8_string(self):
845 self.assertEqual('foo\xc2\xae',840 self.assertEqual('foo\xc2\xae',
@@ -856,16 +851,11 @@
856 self.assertEqual('foobar', osutils.safe_file_id('foobar'))851 self.assertEqual('foobar', osutils.safe_file_id('foobar'))
857852
858 def test_from_unicode_string_ascii_contents(self):853 def test_from_unicode_string_ascii_contents(self):
859 self.assertEqual('bargam', osutils.safe_file_id(u'bargam', warn=False))854 self.assertRaises(TypeError, osutils.safe_file_id, u'bargam')
860
861 def test_from_unicode_deprecated(self):
862 self.assertEqual('bargam',
863 self.callDeprecated([osutils._file_id_warning],
864 osutils.safe_file_id, u'bargam'))
865855
866 def test_from_unicode_string_unicode_contents(self):856 def test_from_unicode_string_unicode_contents(self):
867 self.assertEqual('bargam\xc2\xae',857 self.assertRaises(TypeError,
868 osutils.safe_file_id(u'bargam\xae', warn=False))858 osutils.safe_file_id, u'bargam\xae')
869859
870 def test_from_utf8_string(self):860 def test_from_utf8_string(self):
871 self.assertEqual('foo\xc2\xae',861 self.assertEqual('foo\xc2\xae',
@@ -1831,32 +1821,6 @@
1831 self.assertRaises(IOError, osutils.resource_string, 'breezy', 'yyy.xx')1821 self.assertRaises(IOError, osutils.resource_string, 'breezy', 'yyy.xx')
18321822
18331823
1834class TestReCompile(tests.TestCase):
1835
1836 def _deprecated_re_compile_checked(self, *args, **kwargs):
1837 return self.applyDeprecated(symbol_versioning.deprecated_in((2, 2, 0)),
1838 osutils.re_compile_checked, *args, **kwargs)
1839
1840 def test_re_compile_checked(self):
1841 r = self._deprecated_re_compile_checked(r'A*', re.IGNORECASE)
1842 self.assertTrue(r.match('aaaa'))
1843 self.assertTrue(r.match('aAaA'))
1844
1845 def test_re_compile_checked_error(self):
1846 # like https://bugs.launchpad.net/bzr/+bug/251352
1847
1848 # Due to possible test isolation error, re.compile is not lazy at
1849 # this point. We re-install lazy compile.
1850 lazy_regex.install_lazy_compile()
1851 err = self.assertRaises(
1852 errors.BzrCommandError,
1853 self._deprecated_re_compile_checked, '*', re.IGNORECASE, 'test case')
1854 self.assertEqual(
1855 'Invalid regular expression in test case: '
1856 '"*" nothing to repeat',
1857 str(err))
1858
1859
1860class TestDirReader(tests.TestCaseInTempDir):1824class TestDirReader(tests.TestCaseInTempDir):
18611825
1862 scenarios = dir_reader_scenarios()1826 scenarios = dir_reader_scenarios()
18631827
=== modified file 'breezy/tests/test_remote.py'
--- breezy/tests/test_remote.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_remote.py 2017-05-30 21:16:02 +0000
@@ -73,7 +73,6 @@
73 SmartServerRepositoryGetStream_1_19,73 SmartServerRepositoryGetStream_1_19,
74 _stream_to_byte_stream,74 _stream_to_byte_stream,
75 )75 )
76from ..symbol_versioning import deprecated_in
77from . import (76from . import (
78 test_server,77 test_server,
79 )78 )
8079
=== modified file 'breezy/tests/test_repository.py'
--- breezy/tests/test_repository.py 2017-05-25 01:35:55 +0000
+++ breezy/tests/test_repository.py 2017-05-30 21:16:02 +0000
@@ -31,7 +31,6 @@
31 )31 )
32from breezy import (32from breezy import (
33 btree_index,33 btree_index,
34 symbol_versioning,
35 tests,34 tests,
36 transport,35 transport,
37 vf_search,36 vf_search,
3837
=== modified file 'breezy/tests/test_revisionspec.py'
--- breezy/tests/test_revisionspec.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_revisionspec.py 2017-05-30 21:16:02 +0000
@@ -20,7 +20,6 @@
20from breezy import (20from breezy import (
21 errors,21 errors,
22 revision as _mod_revision,22 revision as _mod_revision,
23 symbol_versioning,
24 )23 )
25from breezy.tests import TestCaseWithTransport24from breezy.tests import TestCaseWithTransport
26from breezy.revisionspec import (25from breezy.revisionspec import (
@@ -115,18 +114,6 @@
115114
116class TestRevisionSpecBase(TestRevisionSpec):115class TestRevisionSpecBase(TestRevisionSpec):
117116
118 def test_wants_revision_history(self):
119 # If wants_revision_history = True, then _match_on should get the
120 # branch revision history
121 spec = RevisionSpecMatchOnTrap('foo', _internal=True)
122 spec.wants_revision_history = True
123 self.callDeprecated(['RevisionSpec.wants_revision_history was '
124 'deprecated in 2.5 (RevisionSpecMatchOnTrap).'],
125 spec.in_history, self.tree.branch)
126
127 self.assertEqual((self.tree.branch, ['r1' ,'r2']),
128 spec.last_call)
129
130 def test_wants_no_revision_history(self):117 def test_wants_no_revision_history(self):
131 # If wants_revision_history = False, then _match_on should get None for118 # If wants_revision_history = False, then _match_on should get None for
132 # the branch revision history119 # the branch revision history
133120
=== modified file 'breezy/tests/test_selftest.py'
--- breezy/tests/test_selftest.py 2017-05-23 14:08:03 +0000
+++ breezy/tests/test_selftest.py 2017-05-30 21:16:02 +0000
@@ -539,19 +539,6 @@
539 self.assertRaises(AssertionError, self.assertEqualStat,539 self.assertRaises(AssertionError, self.assertEqualStat,
540 os.lstat("foo"), os.lstat("longname"))540 os.lstat("foo"), os.lstat("longname"))
541541
542 def test_failUnlessExists(self):
543 """Deprecated failUnlessExists and failIfExists"""
544 self.applyDeprecated(
545 deprecated_in((2, 4)),
546 self.failUnlessExists, '.')
547 self.build_tree(['foo/', 'foo/bar'])
548 self.applyDeprecated(
549 deprecated_in((2, 4)),
550 self.failUnlessExists, 'foo/bar')
551 self.applyDeprecated(
552 deprecated_in((2, 4)),
553 self.failIfExists, 'foo/foo')
554
555 def test_assertPathExists(self):542 def test_assertPathExists(self):
556 self.assertPathExists('.')543 self.assertPathExists('.')
557 self.build_tree(['foo/', 'foo/bar'])544 self.build_tree(['foo/', 'foo/bar'])
558545
=== modified file 'breezy/tests/test_smart_add.py'
--- breezy/tests/test_smart_add.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_smart_add.py 2017-05-30 21:16:02 +0000
@@ -16,6 +16,7 @@
1616
17from .. import (17from .. import (
18 add,18 add,
19 cache_utf8,
19 inventory,20 inventory,
20 osutils,21 osutils,
21 tests,22 tests,
@@ -30,9 +31,7 @@
30 def __call__(self, inv, parent_ie, path, kind):31 def __call__(self, inv, parent_ie, path, kind):
31 # The first part just logs if appropriate32 # The first part just logs if appropriate
32 # Now generate a custom id33 # Now generate a custom id
33 file_id = osutils.safe_file_id(kind + '-'34 file_id = cache_utf8.encode(kind + '-' + path.replace('/', '%'))
34 + path.replace('/', '%'),
35 warn=False)
36 if self.should_print:35 if self.should_print:
37 self._to_file.write('added %s with id %s\n'36 self._to_file.write('added %s with id %s\n'
38 % (path, file_id))37 % (path, file_id))
3938
=== modified file 'breezy/tests/test_transform.py'
--- breezy/tests/test_transform.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/test_transform.py 2017-05-30 21:16:02 +0000
@@ -27,7 +27,6 @@
27 osutils,27 osutils,
28 revision as _mod_revision,28 revision as _mod_revision,
29 rules,29 rules,
30 symbol_versioning,
31 tests,30 tests,
32 trace,31 trace,
33 transform,32 transform,
3433
=== modified file 'breezy/transform.py'
--- breezy/transform.py 2017-05-25 01:35:55 +0000
+++ breezy/transform.py 2017-05-30 21:16:02 +0000
@@ -61,11 +61,6 @@
61 splitpath,61 splitpath,
62 )62 )
63from .progress import ProgressPhase63from .progress import ProgressPhase
64from .symbol_versioning import (
65 deprecated_function,
66 deprecated_in,
67 deprecated_method,
68 )
6964
7065
71ROOT_PARENT = "root-parent"66ROOT_PARENT = "root-parent"
@@ -2051,12 +2046,6 @@
2051 pass2046 pass
20522047
2053 @property2048 @property
2054 @deprecated_method(deprecated_in((2, 5, 0)))
2055 def inventory(self):
2056 """This Tree does not use inventory as its backing data."""
2057 raise NotImplementedError(_PreviewTree.inventory)
2058
2059 @property
2060 def root_inventory(self):2049 def root_inventory(self):
2061 """This Tree does not use inventory as its backing data."""2050 """This Tree does not use inventory as its backing data."""
2062 raise NotImplementedError(_PreviewTree.root_inventory)2051 raise NotImplementedError(_PreviewTree.root_inventory)
20632052
=== modified file 'breezy/transport/__init__.py'
--- breezy/transport/__init__.py 2017-05-25 01:35:55 +0000
+++ breezy/transport/__init__.py 2017-05-30 21:16:02 +0000
@@ -38,7 +38,6 @@
38from breezy import (38from breezy import (
39 errors,39 errors,
40 osutils,40 osutils,
41 symbol_versioning,
42 ui,41 ui,
43 urlutils,42 urlutils,
44 )43 )
@@ -48,9 +47,6 @@
48 BytesIO,47 BytesIO,
49 string_types,48 string_types,
50 )49 )
51from ..symbol_versioning import (
52 DEPRECATED_PARAMETER,
53 )
54from ..trace import (50from ..trace import (
55 mutter,51 mutter,
56 )52 )
@@ -922,15 +918,7 @@
922 None means just use the default.918 None means just use the default.
923 :return: The length of the file that was written.919 :return: The length of the file that was written.
924 """920 """
925 # We would like to mark this as NotImplemented, but most likely921 raise NotImplementedError(self.put_file)
926 # transports have defined it in terms of the old api.
927 symbol_versioning.warn('Transport %s should implement put_file,'
928 ' rather than implementing put() as of'
929 ' version 0.11.'
930 % (self.__class__.__name__,),
931 DeprecationWarning)
932 return self.put(relpath, f, mode=mode)
933 #raise NotImplementedError(self.put_file)
934922
935 def put_file_non_atomic(self, relpath, f, mode=None,923 def put_file_non_atomic(self, relpath, f, mode=None,
936 create_parent_dir=False,924 create_parent_dir=False,
@@ -1001,12 +989,7 @@
1001989
1002 :returns: the length of relpath before the content was written to it.990 :returns: the length of relpath before the content was written to it.
1003 """991 """
1004 symbol_versioning.warn('Transport %s should implement append_file,'992 raise NotImplementedError(self.append_file)
1005 ' rather than implementing append() as of'
1006 ' version 0.11.'
1007 % (self.__class__.__name__,),
1008 DeprecationWarning)
1009 return self.append(relpath, f, mode=mode)
1010993
1011 def append_bytes(self, relpath, bytes, mode=None):994 def append_bytes(self, relpath, bytes, mode=None):
1012 """Append bytes to a file at relpath.995 """Append bytes to a file at relpath.
1013996
=== modified file 'breezy/transport/ftp/__init__.py'
--- breezy/transport/ftp/__init__.py 2017-05-22 00:56:52 +0000
+++ breezy/transport/ftp/__init__.py 2017-05-30 21:16:02 +0000
@@ -44,12 +44,6 @@
44from ...sixish import (44from ...sixish import (
45 BytesIO,45 BytesIO,
46 )46 )
47from ...symbol_versioning import (
48 DEPRECATED_PARAMETER,
49 deprecated_in,
50 deprecated_passed,
51 warn,
52 )
53from ...trace import mutter, warning47from ...trace import mutter, warning
54from ...transport import (48from ...transport import (
55 AppendBasedFileStream,49 AppendBasedFileStream,
5650
=== modified file 'breezy/transport/gio_transport.py'
--- breezy/transport/gio_transport.py 2017-05-22 00:56:52 +0000
+++ breezy/transport/gio_transport.py 2017-05-30 21:16:02 +0000
@@ -43,12 +43,6 @@
43from ..sixish import (43from ..sixish import (
44 BytesIO,44 BytesIO,
45 )45 )
46from ..symbol_versioning import (
47 DEPRECATED_PARAMETER,
48 deprecated_in,
49 deprecated_passed,
50 warn,
51 )
52from ..trace import mutter46from ..trace import mutter
53from . import (47from . import (
54 FileStream,48 FileStream,
5549
=== modified file 'breezy/transport/local.py'
--- breezy/transport/local.py 2017-05-22 00:56:52 +0000
+++ breezy/transport/local.py 2017-05-30 21:16:02 +0000
@@ -34,7 +34,6 @@
34 atomicfile,34 atomicfile,
35 osutils,35 osutils,
36 urlutils,36 urlutils,
37 symbol_versioning,
38 )37 )
39from breezy.transport import LateReadError38from breezy.transport import LateReadError
40""")39""")
4140
=== modified file 'breezy/tree.py'
--- breezy/tree.py 2017-05-25 01:35:55 +0000
+++ breezy/tree.py 2017-05-30 21:16:02 +0000
@@ -42,10 +42,6 @@
4242
43from .decorators import needs_read_lock43from .decorators import needs_read_lock
44from .inter import InterObject44from .inter import InterObject
45from .symbol_versioning import (
46 deprecated_in,
47 deprecated_method,
48 )
4945
5046
51class Tree(object):47class Tree(object):
@@ -138,10 +134,6 @@
138 def has_id(self, file_id):134 def has_id(self, file_id):
139 raise NotImplementedError(self.has_id)135 raise NotImplementedError(self.has_id)
140136
141 @deprecated_method(deprecated_in((2, 4, 0)))
142 def __contains__(self, file_id):
143 return self.has_id(file_id)
144
145 def has_or_had_id(self, file_id):137 def has_or_had_id(self, file_id):
146 raise NotImplementedError(self.has_or_had_id)138 raise NotImplementedError(self.has_or_had_id)
147139
@@ -781,13 +773,6 @@
781 yield cur_path773 yield cur_path
782 # all done.774 # all done.
783775
784 @deprecated_method(deprecated_in((2, 5, 0)))
785 def _get_inventory(self):
786 return self._inventory
787
788 inventory = property(_get_inventory,
789 doc="Inventory of this Tree")
790
791 def _get_root_inventory(self):776 def _get_root_inventory(self):
792 return self._inventory777 return self._inventory
793778
@@ -839,10 +824,6 @@
839 def all_file_ids(self):824 def all_file_ids(self):
840 return {entry.file_id for path, entry in self.iter_entries_by_dir()}825 return {entry.file_id for path, entry in self.iter_entries_by_dir()}
841826
842 @deprecated_method(deprecated_in((2, 4, 0)))
843 def __iter__(self):
844 return iter(self.all_file_ids())
845
846 def filter_unversioned_files(self, paths):827 def filter_unversioned_files(self, paths):
847 """Filter out paths that are versioned.828 """Filter out paths that are versioned.
848829
@@ -885,10 +866,6 @@
885 inv, inv_file_id = self._unpack_file_id(file_id)866 inv, inv_file_id = self._unpack_file_id(file_id)
886 return inv[inv_file_id].children.itervalues()867 return inv[inv_file_id].children.itervalues()
887868
888 @deprecated_method(deprecated_in((2, 5, 0)))
889 def get_file_by_path(self, path):
890 return self.get_file(self.path2id(path), path)
891
892 def iter_children(self, file_id, path=None):869 def iter_children(self, file_id, path=None):
893 """See Tree.iter_children."""870 """See Tree.iter_children."""
894 entry = self.iter_entries_by_dir([file_id]).next()[1]871 entry = self.iter_entries_by_dir([file_id]).next()[1]
895872
=== modified file 'breezy/vf_repository.py'
--- breezy/vf_repository.py 2017-05-25 01:35:55 +0000
+++ breezy/vf_repository.py 2017-05-30 21:16:02 +0000
@@ -37,7 +37,6 @@
37 revision as _mod_revision,37 revision as _mod_revision,
38 serializer as _mod_serializer,38 serializer as _mod_serializer,
39 static_tuple,39 static_tuple,
40 symbol_versioning,
41 tsort,40 tsort,
42 ui,41 ui,
43 versionedfile,42 versionedfile,
@@ -2643,13 +2642,10 @@
26432642
2644 @needs_read_lock2643 @needs_read_lock
2645 def search_missing_revision_ids(self,2644 def search_missing_revision_ids(self,
2646 revision_id=symbol_versioning.DEPRECATED_PARAMETER,
2647 find_ghosts=True, revision_ids=None, if_present_ids=None,2645 find_ghosts=True, revision_ids=None, if_present_ids=None,
2648 limit=None):2646 limit=None):
2649 """Return the revision ids that source has that target does not.2647 """Return the revision ids that source has that target does not.
26502648
2651 :param revision_id: only return revision ids included by this
2652 revision_id.
2653 :param revision_ids: return revision ids included by these2649 :param revision_ids: return revision ids included by these
2654 revision_ids. NoSuchRevision will be raised if any of these2650 revision_ids. NoSuchRevision will be raised if any of these
2655 revisions are not present.2651 revisions are not present.
@@ -2661,17 +2657,6 @@
2661 rather than just finding the surface difference.2657 rather than just finding the surface difference.
2662 :return: A breezy.graph.SearchResult.2658 :return: A breezy.graph.SearchResult.
2663 """2659 """
2664 if symbol_versioning.deprecated_passed(revision_id):
2665 symbol_versioning.warn(
2666 'search_missing_revision_ids(revision_id=...) was '
2667 'deprecated in 2.4. Use revision_ids=[...] instead.',
2668 DeprecationWarning, stacklevel=2)
2669 if revision_ids is not None:
2670 raise AssertionError(
2671 'revision_ids is mutually exclusive with revision_id')
2672 if revision_id is not None:
2673 revision_ids = [revision_id]
2674 del revision_id
2675 # stop searching at found target revisions.2660 # stop searching at found target revisions.
2676 if not find_ghosts and (revision_ids is not None or if_present_ids is2661 if not find_ghosts and (revision_ids is not None or if_present_ids is
2677 not None):2662 not None):
26782663
=== modified file 'breezy/weave.py'
--- breezy/weave.py 2017-05-24 19:44:00 +0000
+++ breezy/weave.py 2017-05-30 21:16:02 +0000
@@ -88,7 +88,6 @@
88from .sixish import (88from .sixish import (
89 BytesIO,89 BytesIO,
90 )90 )
91from .symbol_versioning import *
92from .trace import mutter91from .trace import mutter
93from .versionedfile import (92from .versionedfile import (
94 AbsentContentFactory,93 AbsentContentFactory,
9594
=== modified file 'breezy/workingtree.py'
--- breezy/workingtree.py 2017-05-25 01:35:55 +0000
+++ breezy/workingtree.py 2017-05-30 21:16:02 +0000
@@ -48,6 +48,7 @@
4848
49from breezy import (49from breezy import (
50 branch,50 branch,
51 cache_utf8,
51 conflicts as _mod_conflicts,52 conflicts as _mod_conflicts,
52 controldir,53 controldir,
53 errors,54 errors,
@@ -76,7 +77,6 @@
76from . import (77from . import (
77 bzrdir,78 bzrdir,
78 osutils,79 osutils,
79 symbol_versioning,
80 )80 )
81from .decorators import needs_read_lock, needs_write_lock81from .decorators import needs_read_lock, needs_write_lock
82from .i18n import gettext82from .i18n import gettext
@@ -97,10 +97,6 @@
97 BytesIO,97 BytesIO,
98 )98 )
99from .trace import mutter, note99from .trace import mutter, note
100from .symbol_versioning import (
101 deprecated_passed,
102 DEPRECATED_PARAMETER,
103 )
104100
105101
106MERGE_MODIFIED_HEADER_1 = "BZR merge-modified list format 1"102MERGE_MODIFIED_HEADER_1 = "BZR merge-modified list format 1"
@@ -180,7 +176,7 @@
180 return views.DisabledViews(self)176 return views.DisabledViews(self)
181177
182 def __init__(self, basedir='.',178 def __init__(self, basedir='.',
183 branch=DEPRECATED_PARAMETER,179 branch=None,
184 _internal=False,180 _internal=False,
185 _transport=None,181 _transport=None,
186 _format=None,182 _format=None,
@@ -196,7 +192,7 @@
196 "WorkingTree.open() to obtain a WorkingTree.")192 "WorkingTree.open() to obtain a WorkingTree.")
197 basedir = safe_unicode(basedir)193 basedir = safe_unicode(basedir)
198 mutter("opening working tree %r", basedir)194 mutter("opening working tree %r", basedir)
199 if deprecated_passed(branch):195 if branch is not None:
200 self._branch = branch196 self._branch = branch
201 else:197 else:
202 self._branch = self.bzrdir.open_branch()198 self._branch = self.bzrdir.open_branch()
@@ -1787,7 +1783,7 @@
1787 """1783 """
17881784
1789 def __init__(self, basedir='.',1785 def __init__(self, basedir='.',
1790 branch=DEPRECATED_PARAMETER,1786 branch=None,
1791 _inventory=None,1787 _inventory=None,
1792 _control_files=None,1788 _control_files=None,
1793 _internal=False,1789 _internal=False,
@@ -2376,7 +2372,7 @@
2376 raise errors.MergeModifiedFormatError()2372 raise errors.MergeModifiedFormatError()
2377 for s in _mod_rio.RioReader(hashfile):2373 for s in _mod_rio.RioReader(hashfile):
2378 # RioReader reads in Unicode, so convert file_ids back to utf82374 # RioReader reads in Unicode, so convert file_ids back to utf8
2379 file_id = osutils.safe_file_id(s.get("file_id"), warn=False)2375 file_id = cache_utf8.encode(s.get("file_id"))
2380 if not self.has_id(file_id):2376 if not self.has_id(file_id):
2381 continue2377 continue
2382 text_hash = s.get("hash")2378 text_hash = s.get("hash")
23832379
=== modified file 'breezy/workingtree_4.py'
--- breezy/workingtree_4.py 2017-05-25 01:35:55 +0000
+++ breezy/workingtree_4.py 2017-05-30 21:16:02 +0000
@@ -72,10 +72,6 @@
72from .sixish import (72from .sixish import (
73 BytesIO,73 BytesIO,
74 )74 )
75from .symbol_versioning import (
76 deprecated_in,
77 deprecated_method,
78 )
79from .transport.local import LocalTransport75from .transport.local import LocalTransport
80from .tree import (76from .tree import (
81 InterTree,77 InterTree,
@@ -433,13 +429,6 @@
433 self._generate_inventory()429 self._generate_inventory()
434 return self._inventory430 return self._inventory
435431
436 @deprecated_method(deprecated_in((2, 5, 0)))
437 def _get_inventory(self):
438 return self.root_inventory
439
440 inventory = property(_get_inventory,
441 doc="Inventory of this Tree")
442
443 root_inventory = property(_get_root_inventory,432 root_inventory = property(_get_root_inventory,
444 "Root inventory of this tree")433 "Root inventory of this tree")
445434
@@ -1951,13 +1940,6 @@
1951 root_inventory = property(_get_root_inventory,1940 root_inventory = property(_get_root_inventory,
1952 doc="Inventory of this Tree")1941 doc="Inventory of this Tree")
19531942
1954 @deprecated_method(deprecated_in((2, 5, 0)))
1955 def _get_inventory(self):
1956 return self.root_inventory
1957
1958 inventory = property(_get_inventory,
1959 doc="Inventory of this Tree")
1960
1961 def get_parent_ids(self):1943 def get_parent_ids(self):
1962 """The parents of a tree in the dirstate are not cached."""1944 """The parents of a tree in the dirstate are not cached."""
1963 return self._repository.get_revision(self._revision_id).parent_ids1945 return self._repository.get_revision(self._revision_id).parent_ids
19641946
=== modified file 'doc/en/release-notes/brz-3.0.txt'
--- doc/en/release-notes/brz-3.0.txt 2017-05-24 20:47:06 +0000
+++ doc/en/release-notes/brz-3.0.txt 2017-05-30 21:16:02 +0000
@@ -55,6 +55,9 @@
55 * Signature of ``load_tests`` used by ``TestLoader`` changed to be55 * Signature of ``load_tests`` used by ``TestLoader`` changed to be
56 compatible with standard libarary unittest. (Martin Packman)56 compatible with standard libarary unittest. (Martin Packman)
5757
58 * All previously deprecated functionality has been removed.
59 (Jelmer Vernooij)
60
58 * Renamed ``breezy.delta.report_delta`` parameter ``filter=`` to61 * Renamed ``breezy.delta.report_delta`` parameter ``filter=`` to
59 ``predicate=``. (Martin Packman)62 ``predicate=``. (Martin Packman)
6063

Subscribers

People subscribed via source and target branches