Rev 6529: (jelmer) Remove deprecated Repository.iter_reverse_revision_history. (Jelmer in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jun 26 14:26:44 UTC 2012


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

------------------------------------------------------------
revno: 6529 [merge]
revision-id: pqm at pqm.ubuntu.com-20120626142644-mp5tlpe3ftzjrdw1
parent: pqm at pqm.ubuntu.com-20120626140058-x12qbjzn5hj18yet
parent: jelmer at samba.org-20120626140114-254k45xmceow99gf
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2012-06-26 14:26:44 +0000
message:
  (jelmer) Remove deprecated Repository.iter_reverse_revision_history. (Jelmer
   Vernooij)
removed:
  bzrlib/tests/per_repository/test_iter_reverse_revision_history.py test_iter_reverse_re-20070217015036-spu7j5ggch7pbpyd-1
modified:
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/per_repository/__init__.py __init__.py-20060131092037-9564957a7d4a841b
  doc/en/release-notes/bzr-2.6.txt bzr2.6.txt-20120116134316-8w1xxom1c7vcu1t5-1
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2012-03-14 14:17:48 +0000
+++ b/bzrlib/remote.py	2012-06-26 12:33:14 +0000
@@ -2709,11 +2709,6 @@
     def supports_rich_root(self):
         return self._format.rich_root_data
 
-    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
-    def iter_reverse_revision_history(self, revision_id):
-        self._ensure_real()
-        return self._real_repository.iter_reverse_revision_history(revision_id)
-
     @property
     def _serializer(self):
         return self._format._serializer

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2012-06-26 12:58:22 +0000
+++ b/bzrlib/repository.py	2012-06-26 14:26:44 +0000
@@ -981,17 +981,6 @@
             raise AssertionError('_iter_for_revno returned too much history')
         return (True, partial_history[-1])
 
-    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
-    def iter_reverse_revision_history(self, revision_id):
-        """Iterate backwards through revision ids in the lefthand history
-
-        :param revision_id: The revision id to start with.  All its lefthand
-            ancestors will be traversed.
-        """
-        graph = self.get_graph()
-        stop_revisions = (None, _mod_revision.NULL_REVISION)
-        return graph.iter_lefthand_ancestry(revision_id, stop_revisions)
-
     def is_shared(self):
         """Return True if this repository is flagged as a shared repository."""
         raise NotImplementedError(self.is_shared)

=== modified file 'bzrlib/tests/per_repository/__init__.py'
--- a/bzrlib/tests/per_repository/__init__.py	2012-02-23 23:41:51 +0000
+++ b/bzrlib/tests/per_repository/__init__.py	2012-06-26 12:33:14 +0000
@@ -120,7 +120,6 @@
         'test_get_parent_map',
         'test_has_same_location',
         'test_has_revisions',
-        'test_iter_reverse_revision_history',
         'test_locking',
         'test_pack',
         'test_reconcile',

=== removed file 'bzrlib/tests/per_repository/test_iter_reverse_revision_history.py'
--- a/bzrlib/tests/per_repository/test_iter_reverse_revision_history.py	2011-09-09 12:17:12 +0000
+++ b/bzrlib/tests/per_repository/test_iter_reverse_revision_history.py	1970-01-01 00:00:00 +0000
@@ -1,173 +0,0 @@
-# Copyright (C) 2007 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-"""Test iter_reverse_revision_history."""
-
-from bzrlib import (
-    errors,
-    tests,
-    )
-from bzrlib.symbol_versioning import deprecated_in
-from bzrlib.tests.per_repository import TestCaseWithRepository
-
-
-class TestIterReverseRevisionHistory(TestCaseWithRepository):
-
-    def create_linear_history(self):
-        tree = self.make_branch_and_memory_tree('tree')
-        tree.lock_write()
-        try:
-            tree.add('')
-            tree.commit('1', rev_id='rev1')
-            tree.commit('2', rev_id='rev2')
-            tree.commit('3', rev_id='rev3')
-            tree.commit('4', rev_id='rev4')
-        finally:
-            tree.unlock()
-        return tree
-
-    def create_linear_history_with_utf8(self):
-        tree = self.make_branch_and_memory_tree('tree')
-        tree.lock_write()
-        try:
-            tree.add('') # needed for MemoryTree
-            try:
-                tree.commit(u'F\xb5', rev_id=u'rev-\xb5'.encode('utf8'))
-            except errors.NonAsciiRevisionId:
-                raise tests.TestSkipped("%s doesn't support non-ascii"
-                                        " revision ids."
-                                        % self.repository_format)
-            tree.commit(u'B\xe5r', rev_id=u'rev-\xe5'.encode('utf8'))
-        finally:
-            tree.unlock()
-        return tree
-
-    def create_merged_history(self):
-        # TODO: jam 20070216 MutableTree doesn't yet have the pull() or
-        #       merge_from_branch() apis. So we have to use real trees for
-        #       this.
-        tree1 = self.make_branch_and_tree('tree1')
-        tree2 = self.make_branch_and_tree('tree2')
-        tree1.lock_write()
-        tree2.lock_write()
-        try:
-            tree1.add('')
-            tree1.commit('rev-1-1', rev_id='rev-1-1')
-            tree2.pull(tree1.branch)
-            tree2.commit('rev-2-2', rev_id='rev-2-2')
-            tree2.commit('rev-2-3', rev_id='rev-2-3')
-            tree2.commit('rev-2-4', rev_id='rev-2-4')
-
-            tree1.commit('rev-1-2', rev_id='rev-1-2')
-            tree1.flush() # workaround merge using _write_inventory
-            tree1.merge_from_branch(tree2.branch)
-            tree1.commit('rev-1-3', rev_id='rev-1-3')
-
-            tree2.commit('rev-2-5', rev_id='rev-2-5')
-            # Make sure both repositories have all revisions
-            tree1.branch.repository.fetch(tree2.branch.repository,
-                                          revision_id='rev-2-5')
-            tree2.branch.repository.fetch(tree1.branch.repository,
-                                          revision_id='rev-1-3')
-        finally:
-            tree2.unlock()
-            tree1.unlock()
-        return tree1, tree2
-
-    def test_is_generator(self):
-        tree = self.create_linear_history()
-        repo = tree.branch.repository
-        repo.lock_read()
-        self.addCleanup(repo.unlock)
-        rev_history = self.applyDeprecated(deprecated_in((2, 4, 0)),
-            repo.iter_reverse_revision_history, 'rev4')
-        self.assertEqual('rev4', rev_history.next())
-        self.assertEqual('rev3', rev_history.next())
-        self.assertEqual('rev2', rev_history.next())
-        self.assertEqual('rev1', rev_history.next())
-        self.assertRaises(StopIteration, rev_history.next)
-
-    def assertRevHistoryList(self, expected, repo, revision_id):
-        """Assert the return values of iter_reverse_revision_history."""
-        repo.lock_read()
-        try:
-            actual = list(self.applyDeprecated(deprecated_in((2, 4, 0)),
-                repo.iter_reverse_revision_history, revision_id))
-        finally:
-            repo.unlock()
-        self.assertEqual(expected, actual)
-
-    def test_linear_history(self):
-        tree = self.create_linear_history()
-        repo = tree.branch.repository
-
-        self.assertRevHistoryList(['rev4', 'rev3', 'rev2', 'rev1'],
-                                  repo, 'rev4')
-
-    def test_partial_history(self):
-        tree = self.create_linear_history()
-        repo = tree.branch.repository
-
-        self.assertRevHistoryList(['rev3', 'rev2', 'rev1'], repo, 'rev3')
-
-    def test_revision_ids_are_utf8(self):
-        tree = self.create_linear_history_with_utf8()
-        repo = tree.branch.repository
-        self.assertRevHistoryList(['rev-\xc3\xa5', 'rev-\xc2\xb5'],
-                                  repo, 'rev-\xc3\xa5')
-
-    def test_merged_history(self):
-        tree1, tree2 = self.create_merged_history()
-        repo = tree1.branch.repository
-
-        self.assertRevHistoryList(['rev-1-1'],
-                                  repo, 'rev-1-1')
-        self.assertRevHistoryList(['rev-1-2', 'rev-1-1'],
-                                  repo, 'rev-1-2')
-        self.assertRevHistoryList(['rev-1-3', 'rev-1-2', 'rev-1-1'],
-                                  repo, 'rev-1-3')
-        self.assertRevHistoryList(['rev-2-2', 'rev-1-1'],
-                                  repo, 'rev-2-2')
-        self.assertRevHistoryList(['rev-2-3', 'rev-2-2', 'rev-1-1'],
-                                  repo, 'rev-2-3')
-        self.assertRevHistoryList(['rev-2-4', 'rev-2-3', 'rev-2-2', 'rev-1-1'],
-                                  repo, 'rev-2-4')
-        self.assertRevHistoryList(['rev-2-5', 'rev-2-4', 'rev-2-3', 'rev-2-2',
-                                   'rev-1-1'], repo, 'rev-2-5')
-
-    def test_ghost(self):
-        tree = self.make_branch_and_memory_tree('tree')
-        if not tree.branch.repository._format.supports_ghosts:
-            raise tests.TestNotApplicable(
-                "repository format does not support ghosts")
-        tree.lock_write()
-        try:
-            tree.add('')
-            tree.set_parent_ids(['spooky'], allow_leftmost_as_ghost=True)
-            tree.commit('1', rev_id='rev1')
-            tree.commit('2', rev_id='rev2')
-        finally:
-            tree.unlock()
-        iter = self.applyDeprecated(deprecated_in((2, 4, 0)),
-            tree.branch.repository.iter_reverse_revision_history, 'rev2')
-        tree.branch.repository.lock_read()
-        try:
-            self.assertEquals('rev2', iter.next())
-            self.assertEquals('rev1', iter.next())
-            self.assertRaises(errors.RevisionNotPresent, iter.next)
-        finally:
-            tree.branch.repository.unlock()
-

=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt	2012-06-26 13:17:40 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt	2012-06-26 14:26:44 +0000
@@ -58,6 +58,9 @@
 .. Changes that may require updates in plugins or other code that uses
    bzrlib.
 
+* Remove deprecated Repository.iter_reverse_revision_history().
+  (Jelmer Vernooij)
+
 * Remove deprecated ``RepositoryFormat.register_format``.
   (Jelmer Vernooij)
 




More information about the bazaar-commits mailing list