Rev 6501: (vila) Remove some code deprecated in series older than 2.4 (inclusive) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Wed Mar 14 14:39:17 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6501 [merge]
revision-id: pqm at pqm.ubuntu.com-20120314143916-dggf9d1d26j3kizq
parent: pqm at pqm.ubuntu.com-20120314131706-xv4l56l4e3vjlaeo
parent: v.ladeuil+lp at free.fr-20120314141122-go4oninwzpb1x20h
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2012-03-14 14:39:16 +0000
message:
  (vila) Remove some code deprecated in series older than 2.4 (inclusive)
   (Vincent Ladeuil)
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/hooks.py                hooks.py-20070325015548-ix4np2q0kd8452au-1
  bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
  bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
  bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
  bzrlib/store/versioned/__init__.py weavestore.py-20050907094258-88262e0434babab9
  bzrlib/tests/per_branch/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
  bzrlib/tests/per_interbranch/test_push.py test_push.py-20090330192649-pca31sb2ubbtcs15-1
  bzrlib/tests/per_inventory/basics.py basics.py-20070903044446-kdjwbiu1p1zi9phs-1
  bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
  bzrlib/tests/test_hooks.py     test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
  bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
  bzrlib/tests/test_workingtree.py testworkingtree.py-20051004024258-b88d0fe8f101d468
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
  bzrlib/transport/__init__.py   transport.py-20050711165921-4978aa7ce1285ad5
  bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
  bzrlib/transport/gio_transport.py __init__.py-20100430125031-jb4f7q7mtyz55kz3-2
  bzrlib/transport/local.py      local_transport.py-20050711165921-9b1f142bfe480c24
  bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
  doc/en/release-notes/bzr-2.6.txt bzr2.6.txt-20120116134316-8w1xxom1c7vcu1t5-1
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2012-02-23 23:41:51 +0000
+++ b/bzrlib/branch.py	2012-03-14 10:52:42 +0000
@@ -1617,22 +1617,6 @@
     def __ne__(self, other):
         return not (self == other)
 
-    @classmethod
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def get_default_format(klass):
-        """Return the current default format."""
-        return format_registry.get_default()
-
-    @classmethod
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def get_formats(klass):
-        """Get all the known formats.
-
-        Warning: This triggers a load of all lazy registered formats: do not
-        use except when that is desireed.
-        """
-        return format_registry._get_all()
-
     def get_reference(self, controldir, name=None):
         """Get the target reference of the branch in controldir.
 
@@ -1726,21 +1710,6 @@
         """
         raise NotImplementedError(self.open)
 
-    @classmethod
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def register_format(klass, format):
-        """Register a metadir format.
-
-        See MetaDirBranchFormatFactory for the ability to register a format
-        without loading the code the format needs until it is actually used.
-        """
-        format_registry.register(format)
-
-    @classmethod
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def set_default_format(klass, format):
-        format_registry.set_default(format)
-
     def supports_set_append_revisions_only(self):
         """True if this format supports set_append_revisions_only."""
         return False
@@ -3147,14 +3116,6 @@
     :ivar tag_updates: A dict with new tags, see BasicTags.merge_to
     """
 
-    @deprecated_method(deprecated_in((2, 3, 0)))
-    def __int__(self):
-        """Return the relative change in revno.
-
-        :deprecated: Use `new_revno` and `old_revno` instead.
-        """
-        return self.new_revno - self.old_revno
-
     def report(self, to_file):
         tag_conflicts = getattr(self, "tag_conflicts", None)
         tag_updates = getattr(self, "tag_updates", None)
@@ -3190,14 +3151,6 @@
         target, otherwise it will be None.
     """
 
-    @deprecated_method(deprecated_in((2, 3, 0)))
-    def __int__(self):
-        """Return the relative change in revno.
-
-        :deprecated: Use `new_revno` and `old_revno` instead.
-        """
-        return self.new_revno - self.old_revno
-
     def report(self, to_file):
         # TODO: This function gets passed a to_file, but then
         # ignores it and calls note() instead. This is also

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2012-02-23 23:41:51 +0000
+++ b/bzrlib/bzrdir.py	2012-03-14 09:30:48 +0000
@@ -465,10 +465,6 @@
                     stacked=stacked)
         return result
 
-    @deprecated_method(deprecated_in((2, 3, 0)))
-    def generate_backup_name(self, base):
-        return self._available_backup_name(base)
-
     def _available_backup_name(self, base):
         """Find a non-existing backup file name based on base.
 
@@ -1234,16 +1230,6 @@
     """The known .bzr formats."""
 
     @classmethod
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def register_bzrdir_format(klass, format):
-        klass.formats.register(format.get_format_string(), format)
-
-    @classmethod
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def unregister_bzrdir_format(klass, format):
-        klass.formats.remove(format.get_format_string())
-
-    @classmethod
     def probe_transport(klass, transport):
         """Return the .bzrdir style format present in a directory."""
         try:

=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2012-03-08 18:30:33 +0000
+++ b/bzrlib/config.py	2012-03-14 09:30:48 +0000
@@ -205,11 +205,6 @@
         """Returns a unique ID for the config."""
         raise NotImplementedError(self.config_id)
 
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def get_editor(self):
-        """Get the users pop up editor."""
-        raise NotImplementedError
-
     def get_change_editor(self, old_tree, new_tree):
         from bzrlib import diff
         cmd = self._get_change_editor()
@@ -1056,10 +1051,6 @@
         conf._create_from_string(str_or_unicode, save)
         return conf
 
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def get_editor(self):
-        return self._get_user_option('editor')
-
     @needs_write_lock
     def set_user_option(self, option, value):
         """Save option and its value in the configuration."""

=== modified file 'bzrlib/hooks.py'
--- a/bzrlib/hooks.py	2012-01-02 14:41:49 +0000
+++ b/bzrlib/hooks.py	2012-03-14 08:34:10 +0000
@@ -106,12 +106,6 @@
     return pyutils.get_named_object(module_name, member_name)
 
 
- at symbol_versioning.deprecated_function(symbol_versioning.deprecated_in((2, 3)))
-def known_hooks_key_to_parent_and_attribute(key):
-    """See KnownHooksRegistry.key_to_parent_and_attribute."""
-    return known_hooks.key_to_parent_and_attribute(key)
-
-
 class Hooks(dict):
     """A dictionary mapping hook name to a list of callables.
 
@@ -153,18 +147,6 @@
                               deprecated=deprecated, callbacks=callbacks)
         self[name] = hookpoint
 
-    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
-    def create_hook(self, hook):
-        """Create a hook which can have callbacks registered for it.
-
-        :param hook: The hook to create. An object meeting the protocol of
-            bzrlib.hooks.HookPoint. It's name is used as the key for future
-            lookups.
-        """
-        if hook.name in self:
-            raise errors.DuplicateKey(hook.name)
-        self[hook.name] = hook
-
     def docs(self):
         """Generate the documentation for this Hooks instance.
 

=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py	2012-03-05 17:29:08 +0000
+++ b/bzrlib/inventory.py	2012-03-14 08:34:10 +0000
@@ -633,24 +633,6 @@
     inserted, other than through the Inventory API.
     """
 
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def __contains__(self, file_id):
-        """True if this entry contains a file with given id.
-
-        >>> inv = Inventory()
-        >>> inv.add(InventoryFile('123', 'foo.c', ROOT_ID))
-        InventoryFile('123', 'foo.c', parent_id='TREE_ROOT', sha1=None, len=None, revision=None)
-        >>> inv.has_id('123')
-        True
-        >>> inv.has_id('456')
-        False
-
-        Note that this method along with __iter__ are not encouraged for use as
-        they are less clear than specific query methods - they may be rmeoved
-        in the future.
-        """
-        return self.has_id(file_id)
-
     def has_filename(self, filename):
         return bool(self.path2id(filename))
 

=== modified file 'bzrlib/merge.py'
--- a/bzrlib/merge.py	2012-02-23 19:39:07 +0000
+++ b/bzrlib/merge.py	2012-03-14 09:30:48 +0000
@@ -1078,52 +1078,6 @@
                           ))
         return result
 
-    @deprecated_method(deprecated_in((2, 4, 0)))
-    def fix_root(self):
-        if self.tt.final_kind(self.tt.root) is None:
-            self.tt.cancel_deletion(self.tt.root)
-        if self.tt.final_file_id(self.tt.root) is None:
-            self.tt.version_file(self.tt.tree_file_id(self.tt.root),
-                                 self.tt.root)
-        other_root_file_id = self.other_tree.get_root_id()
-        if other_root_file_id is None:
-            return
-        other_root = self.tt.trans_id_file_id(other_root_file_id)
-        if other_root == self.tt.root:
-            return
-        if self.this_tree.has_id(
-            self.other_tree.get_root_id()):
-            # the other tree's root is a non-root in the current tree (as
-            # when a previously unrelated branch is merged into another)
-            return
-        if self.tt.final_kind(other_root) is not None:
-            other_root_is_present = True
-        else:
-            # other_root doesn't have a physical representation. We still need
-            # to move any references to the actual root of the tree.
-            other_root_is_present = False
-        # the other tree root is not present in this tree. We are
-        # calling adjust_path for children which *want* to be present with a
-        # correct place to go.
-        for child_id in self.other_tree.iter_children(
-                self.other_tree.get_root_id()):
-            trans_id = self.tt.trans_id_file_id(child_id)
-            if not other_root_is_present:
-                if self.tt.final_kind(trans_id) is not None:
-                    # The item exist in the final tree and has a defined place
-                    # to go already.
-                    continue
-            # Move the item into the root
-            try:
-                final_name = self.tt.final_name(trans_id)
-            except errors.NoFinalPath:
-                # This file is not present anymore, ignore it.
-                continue
-            self.tt.adjust_path(final_name, self.tt.root, trans_id)
-        if other_root_is_present:
-            self.tt.cancel_creation(other_root)
-            self.tt.cancel_versioning(other_root)
-
     def write_modified(self, results):
         modified_hashes = {}
         for path in results.modified_paths:
@@ -1239,26 +1193,6 @@
         # At this point, the lcas disagree, and the tip disagree
         return 'conflict'
 
-    @staticmethod
-    @deprecated_method(deprecated_in((2, 2, 0)))
-    def scalar_three_way(this_tree, base_tree, other_tree, file_id, key):
-        """Do a three-way test on a scalar.
-        Return "this", "other" or "conflict", depending whether a value wins.
-        """
-        key_base = key(base_tree, file_id)
-        key_other = key(other_tree, file_id)
-        #if base == other, either they all agree, or only THIS has changed.
-        if key_base == key_other:
-            return "this"
-        key_this = key(this_tree, file_id)
-        # "Ambiguous clean merge"
-        if key_this == key_other:
-            return "this"
-        elif key_this == key_base:
-            return "other"
-        else:
-            return "conflict"
-
     def merge_names(self, file_id):
         def get_entry(tree):
             try:

=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py	2012-02-23 19:45:15 +0000
+++ b/bzrlib/repofmt/knitrepo.py	2012-03-14 08:34:10 +0000
@@ -488,21 +488,9 @@
 
     @needs_read_lock
     def search_missing_revision_ids(self,
-            revision_id=symbol_versioning.DEPRECATED_PARAMETER,
             find_ghosts=True, revision_ids=None, if_present_ids=None,
             limit=None):
         """See InterRepository.search_missing_revision_ids()."""
-        if symbol_versioning.deprecated_passed(revision_id):
-            symbol_versioning.warn(
-                'search_missing_revision_ids(revision_id=...) was '
-                'deprecated in 2.4.  Use revision_ids=[...] instead.',
-                DeprecationWarning, stacklevel=2)
-            if revision_ids is not None:
-                raise AssertionError(
-                    'revision_ids is mutually exclusive with revision_id')
-            if revision_id is not None:
-                revision_ids = [revision_id]
-        del revision_id
         source_ids_set = self._present_source_revisions_for(
             revision_ids, if_present_ids)
         # source_ids is the worst possible case we may need to pull.

=== modified file 'bzrlib/store/versioned/__init__.py'
--- a/bzrlib/store/versioned/__init__.py	2011-12-18 15:28:38 +0000
+++ b/bzrlib/store/versioned/__init__.py	2012-03-13 17:25:29 +0000
@@ -219,7 +219,7 @@
                  "is deprecated. Please provide a to_transaction.",
                  DeprecationWarning,
                  stacklevel=2)
-            # we are copying single objects, and there may be open tranasactions
+            # we are copying single objects, and there may be open transactions
             # so again with the passthrough
             to_transaction = PassThroughTransaction()
         pb = bzrlib.ui.ui_factory.nested_progress_bar()

=== modified file 'bzrlib/tests/per_branch/test_push.py'
--- a/bzrlib/tests/per_branch/test_push.py	2012-02-23 23:26:35 +0000
+++ b/bzrlib/tests/per_branch/test_push.py	2012-03-14 10:17:12 +0000
@@ -57,11 +57,6 @@
         # result object contains some structured data
         self.assertEqual(result.old_revid, 'M1')
         self.assertEqual(result.new_revid, 'P2')
-        # and it can be treated as an integer for compatibility
-        self.assertEqual(self.applyDeprecated(
-            symbol_versioning.deprecated_in((2, 3, 0)),
-            result.__int__),
-            0)
 
     def test_push_merged_indirect(self):
         # it should be possible to do a push from one branch into another

=== modified file 'bzrlib/tests/per_interbranch/test_push.py'
--- a/bzrlib/tests/per_interbranch/test_push.py	2012-02-23 23:26:35 +0000
+++ b/bzrlib/tests/per_interbranch/test_push.py	2012-03-14 10:17:12 +0000
@@ -64,11 +64,6 @@
         # result object contains some structured data
         self.assertEqual(result.old_revid, 'M1')
         self.assertEqual(result.new_revid, 'P2')
-        # and it can be treated as an integer for compatibility
-        self.assertEqual(self.applyDeprecated(
-            symbol_versioning.deprecated_in((2, 3, 0)),
-            result.__int__),
-            0)
 
     def test_push_merged_indirect(self):
         # it should be possible to do a push from one branch into another

=== modified file 'bzrlib/tests/per_inventory/basics.py'
--- a/bzrlib/tests/per_inventory/basics.py	2011-06-14 02:21:41 +0000
+++ b/bzrlib/tests/per_inventory/basics.py	2012-03-14 08:34:10 +0000
@@ -152,10 +152,6 @@
         inv = self.inv_to_test_inv(inv)
         self.assertEqual(inv.path2id('src'), 'src-id')
         self.assertEqual(inv.path2id('src/bye.c'), 'bye-id')
-        self.assertTrue(
-            self.applyDeprecated(
-                deprecated_in((2, 4, 0)),
-                inv.__contains__, 'src-id'))
 
     def test_non_directory_children(self):
         """Test path2id when a parent directory has no children"""

=== modified file 'bzrlib/tests/test_branch.py'
--- a/bzrlib/tests/test_branch.py	2012-03-08 16:23:53 +0000
+++ b/bzrlib/tests/test_branch.py	2012-03-14 10:52:42 +0000
@@ -228,29 +228,6 @@
         branch = _mod_branch.Branch.open('.')
         self.assertEquals(branch._format.features, {})
 
-    def test_register_unregister_format(self):
-        # Test the deprecated format registration functions
-        format = SampleBranchFormat()
-        # make a control dir
-        dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
-        # make a branch
-        format.initialize(dir)
-        # register a format for it.
-        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
-            _mod_branch.BranchFormat.register_format, format)
-        # which branch.Open will refuse (not supported)
-        self.assertRaises(errors.UnsupportedFormatError,
-                          _mod_branch.Branch.open, self.get_url())
-        self.make_branch_and_tree('foo')
-        # but open_downlevel will work
-        self.assertEqual(
-            format.open(dir),
-            controldir.ControlDir.open(self.get_url()).open_branch(unsupported=True))
-        # unregister the format
-        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
-            _mod_branch.BranchFormat.unregister_format, format)
-        self.make_branch_and_tree('bar')
-
 
 class TestBranchFormatRegistry(tests.TestCase):
 
@@ -736,19 +713,6 @@
 
 class TestPullResult(tests.TestCase):
 
-    def test_pull_result_to_int(self):
-        # to support old code, the pull result can be used as an int
-        r = _mod_branch.PullResult()
-        r.old_revno = 10
-        r.new_revno = 20
-        # this usage of results is not recommended for new code (because it
-        # doesn't describe very well what happened), but for api stability
-        # it's still supported
-        self.assertEqual(self.applyDeprecated(
-            symbol_versioning.deprecated_in((2, 3, 0)),
-            r.__int__),
-            10)
-
     def test_report_changed(self):
         r = _mod_branch.PullResult()
         r.old_revid = "old-revid"

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2012-02-23 23:26:35 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2012-03-14 09:30:48 +0000
@@ -1404,11 +1404,6 @@
             possible_transports=[self._transport])
         self._bzrdir = bzrdir.BzrDir.open_from_transport(self._transport)
 
-    def test_deprecated_generate_backup_name(self):
-        res = self.applyDeprecated(
-                symbol_versioning.deprecated_in((2, 3, 0)),
-                self._bzrdir.generate_backup_name, 'whatever')
-
     def test_new(self):
         self.assertEqual("a.~1~", self._bzrdir._available_backup_name("a"))
 

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2012-03-08 18:30:33 +0000
+++ b/bzrlib/tests/test_config.py	2012-03-14 09:30:48 +0000
@@ -476,12 +476,6 @@
     def test_constructs(self):
         config.Config()
 
-    def test_no_default_editor(self):
-        self.assertRaises(
-            NotImplementedError,
-            self.applyDeprecated, deprecated_in((2, 4, 0)),
-            config.Config().get_editor)
-
     def test_user_email(self):
         my_config = InstrumentedConfig()
         self.assertEqual('robert.collins at example.org', my_config.user_email())
@@ -1189,12 +1183,6 @@
         my_config = config.GlobalConfig()
         self.assertEqual(None, my_config._get_user_id())
 
-    def test_configured_editor(self):
-        my_config = config.GlobalConfig.from_string(sample_config_text)
-        editor = self.applyDeprecated(
-            deprecated_in((2, 4, 0)), my_config.get_editor)
-        self.assertEqual('vim', editor)
-
     def test_signatures_always(self):
         my_config = config.GlobalConfig.from_string(sample_always_signatures)
         self.assertEqual(config.CHECK_NEVER,

=== modified file 'bzrlib/tests/test_hooks.py'
--- a/bzrlib/tests/test_hooks.py	2012-01-02 14:41:49 +0000
+++ b/bzrlib/tests/test_hooks.py	2012-03-14 08:34:10 +0000
@@ -29,7 +29,6 @@
     install_lazy_named_hook,
     known_hooks,
     known_hooks_key_to_object,
-    known_hooks_key_to_parent_and_attribute,
     )
 from bzrlib.symbol_versioning import (
     deprecated_in,
@@ -38,25 +37,6 @@
 
 class TestHooks(tests.TestCase):
 
-    def test_create_hook_first(self):
-        hooks = Hooks("bzrlib.tests.test_hooks", "some_hooks")
-        doc = ("Invoked after changing the tip of a branch object. Called with"
-            "a bzrlib.branch.PostChangeBranchTipParams object")
-        hook = HookPoint("post_tip_change", doc, (0, 15), None)
-        self.applyDeprecated(deprecated_in((2, 4)), hooks.create_hook, hook)
-        self.assertEqual(hook, hooks['post_tip_change'])
-
-    def test_create_hook_name_collision_errors(self):
-        hooks = Hooks("bzrlib.tests.test_hooks", "some_hooks")
-        doc = ("Invoked after changing the tip of a branch object. Called with"
-            "a bzrlib.branch.PostChangeBranchTipParams object")
-        hook = HookPoint("post_tip_change", doc, (0, 15), None)
-        hook2 = HookPoint("post_tip_change", None, None, None)
-        self.applyDeprecated(deprecated_in((2, 4)), hooks.create_hook, hook)
-        self.assertRaises(errors.DuplicateKey, self.applyDeprecated,
-            deprecated_in((2, 4, 0)), hooks.create_hook, hook2)
-        self.assertEqual(hook, hooks['post_tip_change'])
-
     def test_docs(self):
         """docs() should return something reasonable about the Hooks."""
         class MyHooks(Hooks):
@@ -286,16 +266,6 @@
         self.assertIs(branch.Branch.hooks,
             known_hooks_key_to_object(('bzrlib.branch', 'Branch.hooks')))
 
-    def test_known_hooks_key_to_parent_and_attribute_deprecated(self):
-        self.assertEqual((branch.Branch, 'hooks'),
-            self.applyDeprecated(deprecated_in((2,3)),
-                known_hooks_key_to_parent_and_attribute,
-                ('bzrlib.branch', 'Branch.hooks')))
-        self.assertEqual((branch, 'Branch'),
-            self.applyDeprecated(deprecated_in((2,3)),
-                known_hooks_key_to_parent_and_attribute,
-                ('bzrlib.branch', 'Branch')))
-
     def test_known_hooks_key_to_parent_and_attribute(self):
         self.assertEqual((branch.Branch, 'hooks'),
             known_hooks.key_to_parent_and_attribute(

=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py	2012-02-23 23:26:35 +0000
+++ b/bzrlib/tests/test_transform.py	2012-03-14 10:17:12 +0000
@@ -2410,31 +2410,6 @@
         self.assertEqual('tree', revision.properties['branch-nick'])
 
 
-class TestBackupName(tests.TestCase):
-
-    def test_deprecations(self):
-        class MockTransform(object):
-
-            def has_named_child(self, by_parent, parent_id, name):
-                return name in by_parent.get(parent_id, [])
-
-        class MockEntry(object):
-
-            def __init__(self):
-                object.__init__(self)
-                self.name = "name"
-
-        tt = MockTransform()
-        name1 = self.applyDeprecated(
-            symbol_versioning.deprecated_in((2, 3, 0)),
-            transform.get_backup_name, MockEntry(), {'a':[]}, 'a', tt)
-        self.assertEqual('name.~1~', name1)
-        name2 = self.applyDeprecated(
-            symbol_versioning.deprecated_in((2, 3, 0)),
-            transform._get_backup_name, 'name', {'a':['name.~1~']}, 'a', tt)
-        self.assertEqual('name.~2~', name2)
-
-
 class TestFileMover(tests.TestCaseWithTransport):
 
     def test_file_mover(self):

=== modified file 'bzrlib/tests/test_workingtree.py'
--- a/bzrlib/tests/test_workingtree.py	2011-12-22 19:54:56 +0000
+++ b/bzrlib/tests/test_workingtree.py	2012-03-14 08:34:10 +0000
@@ -218,31 +218,6 @@
                           workingtree.WorkingTreeFormatMetaDir.find_format,
                           dir)
 
-    def test_register_unregister_format(self):
-        format = SampleTreeFormat()
-        # make a control dir
-        dir = bzrdir.BzrDirMetaFormat1().initialize('.')
-        dir.create_repository()
-        dir.create_branch()
-        # make a branch
-        format.initialize(dir)
-        # register a format for it.
-        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
-            workingtree.WorkingTreeFormat.register_format, format)
-        self.assertTrue(format in 
-            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
-                workingtree.WorkingTreeFormat.get_formats))
-        # which branch.Open will refuse (not supported)
-        self.assertRaises(errors.UnsupportedFormatError, workingtree.WorkingTree.open, '.')
-        # but open_downlevel will work
-        self.assertEqual(format.open(dir), workingtree.WorkingTree.open_downlevel('.'))
-        # unregister the format
-        self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
-            workingtree.WorkingTreeFormat.unregister_format, format)
-        self.assertFalse(format in
-            self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
-                workingtree.WorkingTreeFormat.get_formats))
-
     def test_find_format_with_features(self):
         tree = self.make_branch_and_tree('.', format='2a')
         tree.update_feature_flags({"name": "necessity"})

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2012-03-05 17:29:08 +0000
+++ b/bzrlib/transform.py	2012-03-14 10:17:12 +0000
@@ -575,11 +575,6 @@
             # ensure that all children are registered with the transaction
             list(self.iter_tree_children(parent_id))
 
-    @deprecated_method(deprecated_in((2, 3, 0)))
-    def has_named_child(self, by_parent, parent_id, name):
-        return self._has_named_child(
-            name, parent_id, known_children=by_parent.get(parent_id, []))
-
     def _has_named_child(self, name, parent_id, known_children):
         """Does a parent already have a name child.
 
@@ -2829,24 +2824,6 @@
         tt.set_executability(entry.executable, trans_id)
 
 
- at deprecated_function(deprecated_in((2, 3, 0)))
-def get_backup_name(entry, by_parent, parent_trans_id, tt):
-    return _get_backup_name(entry.name, by_parent, parent_trans_id, tt)
-
-
- at deprecated_function(deprecated_in((2, 3, 0)))
-def _get_backup_name(name, by_parent, parent_trans_id, tt):
-    """Produce a backup-style name that appears to be available"""
-    def name_gen():
-        counter = 1
-        while True:
-            yield "%s.~%d~" % (name, counter)
-            counter += 1
-    for new_name in name_gen():
-        if not tt.has_named_child(by_parent, parent_trans_id, new_name):
-            return new_name
-
-
 def revert(working_tree, target_tree, filenames, backups=False,
            pb=None, change_reporter=None):
     """Revert a working tree's contents to those of a target tree."""

=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py	2012-01-28 12:47:17 +0000
+++ b/bzrlib/transport/__init__.py	2012-03-13 17:25:29 +0000
@@ -138,10 +138,11 @@
 def register_lazy_transport(prefix, module, classname):
     if not prefix in transport_list_registry:
         register_transport_proto(prefix)
-    transport_list_registry.register_lazy_transport_provider(prefix, module, classname)
-
-
-def register_transport(prefix, klass, override=DEPRECATED_PARAMETER):
+    transport_list_registry.register_lazy_transport_provider(
+        prefix, module, classname)
+
+
+def register_transport(prefix, klass):
     if not prefix in transport_list_registry:
         register_transport_proto(prefix)
     transport_list_registry.register_transport_provider(prefix, klass)

=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py	2011-12-19 13:23:58 +0000
+++ b/bzrlib/transport/ftp/__init__.py	2012-03-14 08:34:10 +0000
@@ -248,7 +248,7 @@
             mutter("FTP has not: %s: %s", abspath, e)
             return False
 
-    def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
+    def get(self, relpath, retries=0):
         """Get the file at the given relative path.
 
         :param relpath: The relative path to the file
@@ -258,10 +258,6 @@
         We're meant to return a file-like object which bzr will
         then read from. For now we do this via the magic of StringIO
         """
-        if deprecated_passed(decode):
-            warn(deprecated_in((2,3,0)) %
-                 '"decode" parameter to FtpTransport.get()',
-                 DeprecationWarning, stacklevel=2)
         try:
             mutter("FTP get: %s", self._remote_path(relpath))
             f = self._get_FTP()
@@ -279,7 +275,7 @@
             else:
                 warning("FTP temporary error: %s. Retrying.", str(e))
                 self._reconnect()
-                return self.get(relpath, decode, retries+1)
+                return self.get(relpath, retries+1)
         except EOFError, e:
             if retries > _number_of_retries:
                 raise errors.TransportError("FTP control connection closed during GET %s."
@@ -289,7 +285,7 @@
                 warning("FTP control connection closed. Trying to reopen.")
                 time.sleep(_sleep_between_retries)
                 self._reconnect()
-                return self.get(relpath, decode, retries+1)
+                return self.get(relpath, retries+1)
 
     def put_file(self, relpath, fp, mode=None, retries=0):
         """Copy the file-like or string object into the location.

=== modified file 'bzrlib/transport/gio_transport.py'
--- a/bzrlib/transport/gio_transport.py	2011-12-19 13:23:58 +0000
+++ b/bzrlib/transport/gio_transport.py	2012-03-14 08:34:10 +0000
@@ -271,7 +271,7 @@
             else:
                 self._translate_gio_error(e, relpath)
 
-    def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
+    def get(self, relpath, retries=0):
         """Get the file at the given relative path.
 
         :param relpath: The relative path to the file
@@ -281,10 +281,6 @@
         We're meant to return a file-like object which bzr will
         then read from. For now we do this via the magic of StringIO
         """
-        if deprecated_passed(decode):
-            warn(deprecated_in((2,3,0)) %
-                 '"decode" parameter to GioTransport.get()',
-                 DeprecationWarning, stacklevel=2)
         try:
             if 'gio' in debug.debug_flags:
                 mutter("GIO get: %s" % relpath)

=== modified file 'bzrlib/transport/local.py'
--- a/bzrlib/transport/local.py	2011-12-18 12:46:49 +0000
+++ b/bzrlib/transport/local.py	2012-03-13 17:25:29 +0000
@@ -52,15 +52,7 @@
     def __init__(self, base):
         """Set the base path where files will be stored."""
         if not base.startswith('file://'):
-            symbol_versioning.warn(
-                "Instantiating LocalTransport with a filesystem path"
-                " is deprecated as of bzr 0.8."
-                " Please use bzrlib.transport.get_transport()"
-                " or pass in a file:// url.",
-                 DeprecationWarning,
-                 stacklevel=2
-                 )
-            base = urlutils.local_path_to_url(base)
+            raise AssertionError("not a file:// url: %r" % base)
         if base[-1] != '/':
             base = base + '/'
 

=== modified file 'bzrlib/transport/remote.py'
--- a/bzrlib/transport/remote.py	2011-12-30 14:19:53 +0000
+++ b/bzrlib/transport/remote.py	2012-03-13 17:25:29 +0000
@@ -36,9 +36,6 @@
     urlutils,
     )
 from bzrlib.smart import client, medium
-from bzrlib.symbol_versioning import (
-    deprecated_method,
-    )
 
 
 class _SmartStat(object):

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2012-02-17 16:39:09 +0000
+++ b/bzrlib/workingtree.py	2012-03-14 08:34:10 +0000
@@ -3078,13 +3078,6 @@
     def __ne__(self, other):
         return not (self == other)
 
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def get_default_format(klass):
-        """Return the current default format."""
-        return format_registry.get_default()
-
     def get_format_description(self):
         """Return the short description for this format."""
         raise NotImplementedError(self.get_format_description)
@@ -3106,42 +3099,6 @@
         """True if this format supports stored views."""
         return False
 
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def register_format(klass, format):
-        format_registry.register(format)
-
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def register_extra_format(klass, format):
-        format_registry.register_extra(format)
-
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def unregister_extra_format(klass, format):
-        format_registry.unregister_extra(format)
-
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def get_formats(klass):
-        return format_registry._get_all()
-
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def set_default_format(klass, format):
-        format_registry.set_default(format)
-
-    @classmethod
-    @symbol_versioning.deprecated_method(
-        symbol_versioning.deprecated_in((2, 4, 0)))
-    def unregister_format(klass, format):
-        format_registry.remove(format)
-
     def get_controldir_for_branch(self):
         """Get the control directory format for creating branches.
 

=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt	2012-03-14 10:29:44 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt	2012-03-14 14:39:16 +0000
@@ -91,6 +91,35 @@
 * New convenience API method ``WorkingTree.get_config_stack``.
   (Jelmer Vernooij)
 
+* Remove 
+  ``branch.PullResult.__int__`` deprecated in 2.3.0,
+  ``branch.PushResult.__int__`` deprecated in 2.3.0,
+  ``branch.BranchFormat.get_default_format`` deprecated in 2.4.0,
+  ``branch.BranchFormat.get_formats`` deprecated in 2.4.0,
+  ``branch.BranchFormat.set_default_format`` deprecated in 2.4.0,
+  ``branch.BranchFormat.register_format`` deprecated in 2.4.0,
+  ``branch.BranchFormat.unregister_format`` deprecated in 2.4.0,
+  ``bzrdir.BzrDir.generate_backup_name`` deprecated in 2.3.0,
+  ``bzrdir.BzrProber.register_bzrdir_format`` deprecated in 2.4.0,
+  ``bzrdir.BzrProber.unregister_bzrdir_format`` deprecated in 2.4.0,
+  ``config.Config.get_editor`` deprecated in 2.4.0,
+  ``hooks.known_hooks_key_to_parent_and_attribute`` deprecated in 2.3,
+  ``hooks.Hooks.create_hook`` deprecated in 2.4,
+  ``inventory.Inventory.__contains__`` deprecated in 2.4.0,
+  ``merge.Merge3Merger.scalar_three_way`` deprecated in 2.2.0,
+  ``merge.Merge3Merger.fix_root`` deprecated in 2.4.0,
+  ``transform.TreeTransformBase.has_named_child`` deprecated in 2.3.0,
+  ``transform.get_backup_name`` deprecated in 2.3.0,
+  ``transform._get_backup_name`` deprecated in 2.3.0,
+  ``workingtree.WorkingTreeFormat.get_default_format`` deprecated in 2.4.0,
+  ``workingtree.WorkingTreeFormat.register_format`` deprecated in 2.4.0,
+  ``workingtree.WorkingTreeFormat.register_extra_format`` deprecated in 2.4.0,
+  ``workingtree.WorkingTreeFormat.unregister_extra_format`` deprecated in 2.4.0,
+  ``workingtree.WorkingTreeFormat.get_formats`` deprecated in 2.4.0,
+  ``workingtree.WorkingTreeFormat.set_default_format`` deprecated in 2.4.0,
+  ``workingtree.WorkingTreeFormat.unregister_format`` deprecated in 2.4.0,
+  (Vincent Ladeuil)
+
 Internals
 *********
 




More information about the bazaar-commits mailing list