~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Robert Collins
  • Date: 2008-04-09 00:34:54 UTC
  • mto: This revision was merged to the branch mainline in revision 3350.
  • Revision ID: robertc@robertcollins.net-20080409003454-x19fm1n0o2govzh6
 * ``VersionedFile.annotate_iter`` is deprecated. While in principal this
   allows lower memory use, all users of annotations wanted full file 
   annotations, and there is no storage format suitable for incremental
   line-by-line annotation. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    KnitSequenceMatcher,
57
57
    )
58
58
from bzrlib.osutils import split_lines
 
59
from bzrlib.symbol_versioning import one_four
59
60
from bzrlib.tests import (
60
61
    Feature,
61
62
    TestCase,
161
162
        self.assertEqual(content.annotate(),
162
163
            [("bogus", "text1"), ("bogus", "text2")])
163
164
 
164
 
    def test_annotate_iter(self):
165
 
        content = self._make_content([])
166
 
        it = content.annotate_iter()
167
 
        self.assertRaises(StopIteration, it.next)
168
 
 
169
 
        content = self._make_content([("bogus", "text1"), ("bogus", "text2")])
170
 
        it = content.annotate_iter()
171
 
        self.assertEqual(it.next(), ("bogus", "text1"))
172
 
        self.assertEqual(it.next(), ("bogus", "text2"))
173
 
        self.assertRaises(StopIteration, it.next)
174
 
 
175
165
    def test_line_delta(self):
176
166
        content1 = self._make_content([("", "a"), ("", "b")])
177
167
        content2 = self._make_content([("", "a"), ("", "a"), ("", "c")])
199
189
        self.assertEqual(content.annotate(),
200
190
            [("origin1", "text1"), ("origin2", "text2")])
201
191
 
202
 
    def test_annotate_iter(self):
203
 
        content = self._make_content([])
204
 
        it = content.annotate_iter()
205
 
        self.assertRaises(StopIteration, it.next)
206
 
 
207
 
        content = self._make_content([("origin1", "text1"), ("origin2", "text2")])
208
 
        it = content.annotate_iter()
209
 
        self.assertEqual(it.next(), ("origin1", "text1"))
210
 
        self.assertEqual(it.next(), ("origin2", "text2"))
211
 
        self.assertRaises(StopIteration, it.next)
212
 
 
213
192
    def test_line_delta(self):
214
193
        content1 = self._make_content([("", "a"), ("", "b")])
215
194
        content2 = self._make_content([("", "a"), ("", "a"), ("", "c")])