Merge lp:~jelmer/bzr/rm-iter-reverse-revision-history into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 6529
Proposed branch: lp:~jelmer/bzr/rm-iter-reverse-revision-history
Merge into: lp:bzr
Diff against target: 246 lines (+6/-190) (has conflicts)
5 files modified
bzrlib/remote.py (+0/-5)
bzrlib/repository.py (+0/-11)
bzrlib/tests/per_repository/__init__.py (+0/-1)
bzrlib/tests/per_repository/test_iter_reverse_revision_history.py (+0/-173)
doc/en/release-notes/bzr-2.6.txt (+6/-0)
Text conflict in doc/en/release-notes/bzr-2.6.txt
To merge this branch: bzr merge lp:~jelmer/bzr/rm-iter-reverse-revision-history
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+112092@code.launchpad.net

Commit message

Remove deprecated Repository.iter_reverse_revision_history.

Description of the change

Remove deprecated Repository.iter_reverse_revision_history.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/26/2012 02:36 PM, Jelmer Vernooij wrote:
> Jelmer Vernooij has proposed merging
> lp:~jelmer/bzr/rm-iter-reverse-revision-history into lp:bzr.
>
> Requested reviews: bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~jelmer/bzr/rm-iter-reverse-revision-history/+merge/112092
>
> Remove deprecated Repository.iter_reverse_revision_history.
>

 merge: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/ptV0ACgkQJdeBCYSNAANZNwCeNca0VgKCrm1lUjAg4Kj8wFK5
EHEAniLaJ3QBIkEEiQl4KarRhPxn+9BH
=k3IR
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/remote.py'
2--- bzrlib/remote.py 2012-03-14 14:17:48 +0000
3+++ bzrlib/remote.py 2012-06-26 14:03:22 +0000
4@@ -2709,11 +2709,6 @@
5 def supports_rich_root(self):
6 return self._format.rich_root_data
7
8- @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
9- def iter_reverse_revision_history(self, revision_id):
10- self._ensure_real()
11- return self._real_repository.iter_reverse_revision_history(revision_id)
12-
13 @property
14 def _serializer(self):
15 return self._format._serializer
16
17=== modified file 'bzrlib/repository.py'
18--- bzrlib/repository.py 2012-06-26 12:58:22 +0000
19+++ bzrlib/repository.py 2012-06-26 14:03:22 +0000
20@@ -981,17 +981,6 @@
21 raise AssertionError('_iter_for_revno returned too much history')
22 return (True, partial_history[-1])
23
24- @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
25- def iter_reverse_revision_history(self, revision_id):
26- """Iterate backwards through revision ids in the lefthand history
27-
28- :param revision_id: The revision id to start with. All its lefthand
29- ancestors will be traversed.
30- """
31- graph = self.get_graph()
32- stop_revisions = (None, _mod_revision.NULL_REVISION)
33- return graph.iter_lefthand_ancestry(revision_id, stop_revisions)
34-
35 def is_shared(self):
36 """Return True if this repository is flagged as a shared repository."""
37 raise NotImplementedError(self.is_shared)
38
39=== modified file 'bzrlib/tests/per_repository/__init__.py'
40--- bzrlib/tests/per_repository/__init__.py 2012-02-23 23:41:51 +0000
41+++ bzrlib/tests/per_repository/__init__.py 2012-06-26 14:03:22 +0000
42@@ -120,7 +120,6 @@
43 'test_get_parent_map',
44 'test_has_same_location',
45 'test_has_revisions',
46- 'test_iter_reverse_revision_history',
47 'test_locking',
48 'test_pack',
49 'test_reconcile',
50
51=== removed file 'bzrlib/tests/per_repository/test_iter_reverse_revision_history.py'
52--- bzrlib/tests/per_repository/test_iter_reverse_revision_history.py 2011-09-09 12:17:12 +0000
53+++ bzrlib/tests/per_repository/test_iter_reverse_revision_history.py 1970-01-01 00:00:00 +0000
54@@ -1,173 +0,0 @@
55-# Copyright (C) 2007 Canonical Ltd
56-#
57-# This program is free software; you can redistribute it and/or modify
58-# it under the terms of the GNU General Public License as published by
59-# the Free Software Foundation; either version 2 of the License, or
60-# (at your option) any later version.
61-#
62-# This program is distributed in the hope that it will be useful,
63-# but WITHOUT ANY WARRANTY; without even the implied warranty of
64-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65-# GNU General Public License for more details.
66-#
67-# You should have received a copy of the GNU General Public License
68-# along with this program; if not, write to the Free Software
69-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
70-
71-"""Test iter_reverse_revision_history."""
72-
73-from bzrlib import (
74- errors,
75- tests,
76- )
77-from bzrlib.symbol_versioning import deprecated_in
78-from bzrlib.tests.per_repository import TestCaseWithRepository
79-
80-
81-class TestIterReverseRevisionHistory(TestCaseWithRepository):
82-
83- def create_linear_history(self):
84- tree = self.make_branch_and_memory_tree('tree')
85- tree.lock_write()
86- try:
87- tree.add('')
88- tree.commit('1', rev_id='rev1')
89- tree.commit('2', rev_id='rev2')
90- tree.commit('3', rev_id='rev3')
91- tree.commit('4', rev_id='rev4')
92- finally:
93- tree.unlock()
94- return tree
95-
96- def create_linear_history_with_utf8(self):
97- tree = self.make_branch_and_memory_tree('tree')
98- tree.lock_write()
99- try:
100- tree.add('') # needed for MemoryTree
101- try:
102- tree.commit(u'F\xb5', rev_id=u'rev-\xb5'.encode('utf8'))
103- except errors.NonAsciiRevisionId:
104- raise tests.TestSkipped("%s doesn't support non-ascii"
105- " revision ids."
106- % self.repository_format)
107- tree.commit(u'B\xe5r', rev_id=u'rev-\xe5'.encode('utf8'))
108- finally:
109- tree.unlock()
110- return tree
111-
112- def create_merged_history(self):
113- # TODO: jam 20070216 MutableTree doesn't yet have the pull() or
114- # merge_from_branch() apis. So we have to use real trees for
115- # this.
116- tree1 = self.make_branch_and_tree('tree1')
117- tree2 = self.make_branch_and_tree('tree2')
118- tree1.lock_write()
119- tree2.lock_write()
120- try:
121- tree1.add('')
122- tree1.commit('rev-1-1', rev_id='rev-1-1')
123- tree2.pull(tree1.branch)
124- tree2.commit('rev-2-2', rev_id='rev-2-2')
125- tree2.commit('rev-2-3', rev_id='rev-2-3')
126- tree2.commit('rev-2-4', rev_id='rev-2-4')
127-
128- tree1.commit('rev-1-2', rev_id='rev-1-2')
129- tree1.flush() # workaround merge using _write_inventory
130- tree1.merge_from_branch(tree2.branch)
131- tree1.commit('rev-1-3', rev_id='rev-1-3')
132-
133- tree2.commit('rev-2-5', rev_id='rev-2-5')
134- # Make sure both repositories have all revisions
135- tree1.branch.repository.fetch(tree2.branch.repository,
136- revision_id='rev-2-5')
137- tree2.branch.repository.fetch(tree1.branch.repository,
138- revision_id='rev-1-3')
139- finally:
140- tree2.unlock()
141- tree1.unlock()
142- return tree1, tree2
143-
144- def test_is_generator(self):
145- tree = self.create_linear_history()
146- repo = tree.branch.repository
147- repo.lock_read()
148- self.addCleanup(repo.unlock)
149- rev_history = self.applyDeprecated(deprecated_in((2, 4, 0)),
150- repo.iter_reverse_revision_history, 'rev4')
151- self.assertEqual('rev4', rev_history.next())
152- self.assertEqual('rev3', rev_history.next())
153- self.assertEqual('rev2', rev_history.next())
154- self.assertEqual('rev1', rev_history.next())
155- self.assertRaises(StopIteration, rev_history.next)
156-
157- def assertRevHistoryList(self, expected, repo, revision_id):
158- """Assert the return values of iter_reverse_revision_history."""
159- repo.lock_read()
160- try:
161- actual = list(self.applyDeprecated(deprecated_in((2, 4, 0)),
162- repo.iter_reverse_revision_history, revision_id))
163- finally:
164- repo.unlock()
165- self.assertEqual(expected, actual)
166-
167- def test_linear_history(self):
168- tree = self.create_linear_history()
169- repo = tree.branch.repository
170-
171- self.assertRevHistoryList(['rev4', 'rev3', 'rev2', 'rev1'],
172- repo, 'rev4')
173-
174- def test_partial_history(self):
175- tree = self.create_linear_history()
176- repo = tree.branch.repository
177-
178- self.assertRevHistoryList(['rev3', 'rev2', 'rev1'], repo, 'rev3')
179-
180- def test_revision_ids_are_utf8(self):
181- tree = self.create_linear_history_with_utf8()
182- repo = tree.branch.repository
183- self.assertRevHistoryList(['rev-\xc3\xa5', 'rev-\xc2\xb5'],
184- repo, 'rev-\xc3\xa5')
185-
186- def test_merged_history(self):
187- tree1, tree2 = self.create_merged_history()
188- repo = tree1.branch.repository
189-
190- self.assertRevHistoryList(['rev-1-1'],
191- repo, 'rev-1-1')
192- self.assertRevHistoryList(['rev-1-2', 'rev-1-1'],
193- repo, 'rev-1-2')
194- self.assertRevHistoryList(['rev-1-3', 'rev-1-2', 'rev-1-1'],
195- repo, 'rev-1-3')
196- self.assertRevHistoryList(['rev-2-2', 'rev-1-1'],
197- repo, 'rev-2-2')
198- self.assertRevHistoryList(['rev-2-3', 'rev-2-2', 'rev-1-1'],
199- repo, 'rev-2-3')
200- self.assertRevHistoryList(['rev-2-4', 'rev-2-3', 'rev-2-2', 'rev-1-1'],
201- repo, 'rev-2-4')
202- self.assertRevHistoryList(['rev-2-5', 'rev-2-4', 'rev-2-3', 'rev-2-2',
203- 'rev-1-1'], repo, 'rev-2-5')
204-
205- def test_ghost(self):
206- tree = self.make_branch_and_memory_tree('tree')
207- if not tree.branch.repository._format.supports_ghosts:
208- raise tests.TestNotApplicable(
209- "repository format does not support ghosts")
210- tree.lock_write()
211- try:
212- tree.add('')
213- tree.set_parent_ids(['spooky'], allow_leftmost_as_ghost=True)
214- tree.commit('1', rev_id='rev1')
215- tree.commit('2', rev_id='rev2')
216- finally:
217- tree.unlock()
218- iter = self.applyDeprecated(deprecated_in((2, 4, 0)),
219- tree.branch.repository.iter_reverse_revision_history, 'rev2')
220- tree.branch.repository.lock_read()
221- try:
222- self.assertEquals('rev2', iter.next())
223- self.assertEquals('rev1', iter.next())
224- self.assertRaises(errors.RevisionNotPresent, iter.next)
225- finally:
226- tree.branch.repository.unlock()
227-
228
229=== modified file 'doc/en/release-notes/bzr-2.6.txt'
230--- doc/en/release-notes/bzr-2.6.txt 2012-06-26 13:17:40 +0000
231+++ doc/en/release-notes/bzr-2.6.txt 2012-06-26 14:03:22 +0000
232@@ -58,9 +58,15 @@
233 .. Changes that may require updates in plugins or other code that uses
234 bzrlib.
235
236+<<<<<<< TREE
237 * Remove deprecated ``RepositoryFormat.register_format``.
238 (Jelmer Vernooij)
239
240+=======
241+* Remove deprecated Repository.iter_reverse_revision_history().
242+ (Jelmer Vernooij)
243+
244+>>>>>>> MERGE-SOURCE
245 * The previously deprecated ``bzrlib.annotate.annotate_file`` function
246 has been removed. (Jelmer Vernooij)
247