Rev 5347: (vila) Delete deprecated code. (Vincent Ladeuil) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jul 16 10:26:05 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5347 [merge]
revision-id: pqm at pqm.ubuntu.com-20100716092603-gi09i1u5bp2gb68i
parent: pqm at pqm.ubuntu.com-20100715110657-zb7pmrur0azigjs5
parent: v.ladeuil+lp at free.fr-20100715134131-i2q34l1er6pt17op
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-07-16 10:26:03 +0100
message:
  (vila) Delete deprecated code. (Vincent Ladeuil)
modified:
  bzrlib/bundle/__init__.py      changeset.py-20050513021216-b02ab57fb9738913
  bzrlib/bundle/serializer/__init__.py __init__.py-20051118175413-86b97db0b618feef
  bzrlib/lru_cache.py            lru_cache.py-20070119165515-tlw203kuwh0id5gv-1
  bzrlib/revision.py             revision.py-20050309040759-e77802c08f3999d5
  bzrlib/tests/per_workingtree/test_move.py test_move.py-20070225171927-mohn2vqj5fx7edc6-1
  bzrlib/tests/test_http.py      testhttp.py-20051018020158-b2eef6e867c514d9
  bzrlib/tests/test_lru_cache.py test_lru_cache.py-20070119165535-hph6rk4h9rzy4180-1
  bzrlib/tests/test_read_bundle.py test_read_bundle.py-20060615211421-ud8cwr1ulgd914zf-1
  bzrlib/tests/test_revision.py  testrevision.py-20050804210559-46f5e1eb67b01289
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
  bzrlib/version_info_formats/__init__.py generate_version_info.py-20051228204928-8358edabcddcd97e
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
=== modified file 'bzrlib/bundle/__init__.py'
--- a/bzrlib/bundle/__init__.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/bundle/__init__.py	2010-07-15 12:53:44 +0000
@@ -16,7 +16,6 @@
 
 from cStringIO import StringIO
 
-from bzrlib.symbol_versioning import deprecated_function, deprecated_in
 from bzrlib.lazy_import import lazy_import
 lazy_import(globals(), """
 from bzrlib import (
@@ -33,11 +32,6 @@
 from bzrlib.trace import note
 
 
- at deprecated_function(deprecated_in((1, 12, 0)))
-def read_bundle_from_url(url):
-    return read_mergeable_from_url(url, _do_directive=False)
-
-
 def read_mergeable_from_url(url, _do_directive=True, possible_transports=None):
     """Read mergable object from a given URL.
 

=== modified file 'bzrlib/bundle/serializer/__init__.py'
--- a/bzrlib/bundle/serializer/__init__.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/bundle/serializer/__init__.py	2010-07-15 12:53:00 +0000
@@ -151,17 +151,6 @@
         """
         raise NotImplementedError
 
-    def write(self, source, revision_ids, forced_bases, f):
-        """Write the bundle to the supplied file.
-
-        DEPRECATED: see write_bundle
-        :param source: A source for revision information
-        :param revision_ids: The list of revision ids to serialize
-        :param forced_bases: A dict of revision -> base that overrides default
-        :param f: The file to output to
-        """
-        raise NotImplementedError
-
     def _write_bundle(self, repository, revision_id, base_revision_id, out):
         """Helper function for translating write_bundle to write"""
         forced_bases = {revision_id:base_revision_id}

=== modified file 'bzrlib/lru_cache.py'
--- a/bzrlib/lru_cache.py	2009-07-08 15:43:51 +0000
+++ b/bzrlib/lru_cache.py	2010-07-15 13:05:40 +0000
@@ -17,7 +17,6 @@
 """A simple least-recently-used (LRU) cache."""
 
 from bzrlib import (
-    symbol_versioning,
     trace,
     )
 
@@ -61,14 +60,7 @@
 class LRUCache(object):
     """A class which manages a cache of entries, removing unused ones."""
 
-    def __init__(self, max_cache=100, after_cleanup_count=None,
-                 after_cleanup_size=symbol_versioning.DEPRECATED_PARAMETER):
-        if symbol_versioning.deprecated_passed(after_cleanup_size):
-            symbol_versioning.warn('LRUCache.__init__(after_cleanup_size) was'
-                                   ' deprecated in 1.11. Use'
-                                   ' after_cleanup_count instead.',
-                                   DeprecationWarning)
-            after_cleanup_count = after_cleanup_size
+    def __init__(self, max_cache=100, after_cleanup_count=None):
         self._cache = {}
         # The "HEAD" of the lru linked list
         self._most_recently_used = None

=== modified file 'bzrlib/revision.py'
--- a/bzrlib/revision.py	2010-02-23 07:43:11 +0000
+++ b/bzrlib/revision.py	2010-07-15 12:37:32 +0000
@@ -121,21 +121,6 @@
         else:
             return ''
 
-    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((1, 13, 0)))
-    def get_apparent_author(self):
-        """Return the apparent author of this revision.
-
-        This method is deprecated in favour of get_apparent_authors.
-
-        If the revision properties contain any author names,
-        return the first. Otherwise return the committer name.
-        """
-        authors = self.get_apparent_authors()
-        if authors:
-            return authors[0]
-        else:
-            return None
-
     def get_apparent_authors(self):
         """Return the apparent authors of this revision.
 

=== modified file 'bzrlib/tests/per_workingtree/test_move.py'
--- a/bzrlib/tests/per_workingtree/test_move.py	2009-07-10 07:14:02 +0000
+++ b/bzrlib/tests/per_workingtree/test_move.py	2010-07-15 13:33:30 +0000
@@ -79,43 +79,6 @@
             tree.move(['a1'], 'sub1', after=False))
         tree._validate()
 
-    def test_move_deprecated_wrong_call(self):
-        """tree.move has the deprecated parameter 'to_name'.
-        It has been replaced by 'to_dir' for consistency.
-        Test the new API using wrong parameter
-        """
-        self.build_tree(['a1', 'sub1/'])
-        tree = self.make_branch_and_tree('.')
-        tree.add(['a1', 'sub1'])
-        tree.commit('initial commit')
-        self.assertRaises(TypeError, tree.move, ['a1'],
-                          to_this_parameter_does_not_exist='sub1',
-                          after=False)
-        tree._validate()
-
-    def test_move_deprecated_call(self):
-        """tree.move has the deprecated parameter 'to_name'.
-        It has been replaced by 'to_dir' for consistency.
-        Test the new API using deprecated parameter
-        """
-        self.build_tree(['a1', 'sub1/'])
-        tree = self.make_branch_and_tree('.')
-        tree.add(['a1', 'sub1'])
-        tree.commit('initial commit')
-
-        try:
-            self.callDeprecated(['The parameter to_name was deprecated'
-                                 ' in version 0.13. Use to_dir instead'],
-                                tree.move, ['a1'], to_name='sub1',
-                                after=False)
-        except TypeError:
-            # WorkingTreeFormat4 and later don't have to maintain api
-            # compatibility since it was deprecated before they were introduced.
-            if not isinstance(self.workingtree_format,
-                DirStateWorkingTreeFormat):
-                raise
-        tree._validate()
-
     def test_move_target_not_dir(self):
         tree = self.make_branch_and_tree('.')
         self.build_tree(['a'])

=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py	2010-07-13 19:02:12 +0000
+++ b/bzrlib/tests/test_http.py	2010-07-15 12:53:44 +0000
@@ -44,9 +44,6 @@
     ui,
     urlutils,
     )
-from bzrlib.symbol_versioning import (
-    deprecated_in,
-    )
 from bzrlib.tests import (
     features,
     http_server,
@@ -1339,14 +1336,6 @@
         t = self._transport(self.new_server.get_url())
         self.assertEqual('0123456789', t.get('a').read())
 
-    def test_read_redirected_bundle_from_url(self):
-        from bzrlib.bundle import read_bundle_from_url
-        url = self.old_transport.abspath('bundle')
-        bundle = self.applyDeprecated(deprecated_in((1, 12, 0)),
-                read_bundle_from_url, url)
-        # If read_bundle_from_url was successful we get an empty bundle
-        self.assertEqual([], bundle.revisions)
-
 
 class RedirectedRequest(_urllib2_wrappers.Request):
     """Request following redirections. """

=== modified file 'bzrlib/tests/test_lru_cache.py'
--- a/bzrlib/tests/test_lru_cache.py	2009-07-08 14:28:04 +0000
+++ b/bzrlib/tests/test_lru_cache.py	2010-07-15 13:05:40 +0000
@@ -282,13 +282,6 @@
         cache[6] = 7
         self.assertEqual([2, 3, 4, 5, 6], sorted(cache.keys()))
 
-    def test_after_cleanup_size_deprecated(self):
-        obj = self.callDeprecated([
-            'LRUCache.__init__(after_cleanup_size) was deprecated in 1.11.'
-            ' Use after_cleanup_count instead.'],
-            lru_cache.LRUCache, 50, after_cleanup_size=25)
-        self.assertEqual(obj._after_cleanup_count, 25)
-
     def test_resize_smaller(self):
         cache = lru_cache.LRUCache(max_cache=5, after_cleanup_count=4)
         cache[1] = 2

=== modified file 'bzrlib/tests/test_read_bundle.py'
--- a/bzrlib/tests/test_read_bundle.py	2009-07-10 07:14:02 +0000
+++ b/bzrlib/tests/test_read_bundle.py	2010-07-15 12:53:44 +0000
@@ -35,7 +35,8 @@
 def load_tests(standard_tests, module, loader):
     """Multiply tests for tranport implementations."""
     transport_tests, remaining_tests = tests.split_suite_by_condition(
-        standard_tests, tests.condition_isinstance(TestReadBundleFromURL))
+        standard_tests,
+        tests.condition_isinstance(TestReadMergeableBundleFromURL))
     return tests.multiply_tests(transport_tests, transport_test_permutations(),
         remaining_tests)
 
@@ -60,32 +61,11 @@
     return out, wt
 
 
-class TestDeprecations(tests.TestCaseInTempDir):
-
-    def create_test_bundle(self):
-        out, wt = create_bundle_file(self)
-        f = open('test_bundle', 'wb')
-        try:
-            f.write(out.getvalue())
-        finally:
-            f.close()
-        return wt
-
-    def test_read_bundle_from_url_deprecated(self):
-        wt = self.create_test_bundle()
-        t = bzrlib.transport.get_transport(self.test_dir)
-        url = t.abspath('test_bundle')
-        self.callDeprecated([deprecated_in((1, 12, 0))
-                             % 'bzrlib.bundle.read_bundle_from_url'],
-                            bzrlib.bundle.read_bundle_from_url,
-                            url)
-
-
-class TestReadBundleFromURL(TestTransportImplementation):
+class TestReadMergeableBundleFromURL(TestTransportImplementation):
     """Test that read_bundle works properly across multiple transports"""
 
     def setUp(self):
-        super(TestReadBundleFromURL, self).setUp()
+        super(TestReadMergeableBundleFromURL, self).setUp()
         self.bundle_name = 'test_bundle'
         # read_mergeable_from_url will invoke get_transport which may *not*
         # respect self._transport (i.e. returns a transport that is different

=== modified file 'bzrlib/tests/test_revision.py'
--- a/bzrlib/tests/test_revision.py	2009-06-03 10:24:28 +0000
+++ b/bzrlib/tests/test_revision.py	2010-07-15 12:37:32 +0000
@@ -211,31 +211,6 @@
         r.message = None
         self.assertEqual('', r.get_summary())
 
-    def test_get_apparent_author(self):
-        r = revision.Revision('1')
-        r.committer = 'A'
-        author = self.applyDeprecated(
-                symbol_versioning.deprecated_in((1, 13, 0)),
-                r.get_apparent_author)
-        self.assertEqual('A', author)
-        r.properties['author'] = 'B'
-        author = self.applyDeprecated(
-                symbol_versioning.deprecated_in((1, 13, 0)),
-                r.get_apparent_author)
-        self.assertEqual('B', author)
-        r.properties['authors'] = 'C\nD'
-        author = self.applyDeprecated(
-                symbol_versioning.deprecated_in((1, 13, 0)),
-                r.get_apparent_author)
-        self.assertEqual('C', author)
-
-    def test_get_apparent_author_none(self):
-        r = revision.Revision('1')
-        author = self.applyDeprecated(
-                symbol_versioning.deprecated_in((1, 13, 0)),
-                r.get_apparent_author)
-        self.assertEqual(None, author)
-
     def test_get_apparent_authors(self):
         r = revision.Revision('1')
         r.committer = 'A'

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2010-05-29 15:40:14 +0000
+++ b/bzrlib/transform.py	2010-07-15 13:39:38 +0000
@@ -2529,22 +2529,6 @@
         raise errors.BadFileKindError(name, kind)
 
 
- at deprecated_function(deprecated_in((1, 9, 0)))
-def create_by_entry(tt, entry, tree, trans_id, lines=None, mode_id=None):
-    """Create new file contents according to an inventory entry.
-
-    DEPRECATED.  Use create_from_tree instead.
-    """
-    if entry.kind == "file":
-        if lines is None:
-            lines = tree.get_file(entry.file_id).readlines()
-        tt.create_file(lines, trans_id, mode_id=mode_id)
-    elif entry.kind == "symlink":
-        tt.create_symlink(tree.get_symlink_target(entry.file_id), trans_id)
-    elif entry.kind == "directory":
-        tt.create_directory(trans_id)
-
-
 def create_from_tree(tt, trans_id, tree, file_id, bytes=None,
     filter_tree_path=None):
     """Create new file contents according to tree contents.

=== modified file 'bzrlib/version_info_formats/__init__.py'
--- a/bzrlib/version_info_formats/__init__.py	2009-03-24 01:53:42 +0000
+++ b/bzrlib/version_info_formats/__init__.py	2010-07-15 13:41:31 +0000
@@ -20,9 +20,6 @@
 
 from bzrlib.osutils import local_time_offset, format_date
 from bzrlib import registry
-from bzrlib.symbol_versioning import (
-    deprecated_function,
-    )
 
 
 def create_date_str(timestamp=None, offset=None):

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2010-07-06 19:48:05 +0000
+++ b/bzrlib/workingtree.py	2010-07-15 13:33:30 +0000
@@ -1264,7 +1264,7 @@
                 stack.pop()
 
     @needs_tree_write_lock
-    def move(self, from_paths, to_dir=None, after=False, **kwargs):
+    def move(self, from_paths, to_dir=None, after=False):
         """Rename files.
 
         to_dir must exist in the inventory.
@@ -1304,14 +1304,7 @@
 
         # check for deprecated use of signature
         if to_dir is None:
-            to_dir = kwargs.get('to_name', None)
-            if to_dir is None:
-                raise TypeError('You must supply a target directory')
-            else:
-                symbol_versioning.warn('The parameter to_name was deprecated'
-                                       ' in version 0.13. Use to_dir instead',
-                                       DeprecationWarning)
-
+            raise TypeError('You must supply a target directory')
         # check destination directory
         if isinstance(from_paths, basestring):
             raise ValueError()




More information about the bazaar-commits mailing list