~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: Robert Collins
  • Date: 2008-04-08 04:13:08 UTC
  • mto: This revision was merged to the branch mainline in revision 3350.
  • Revision ID: robertc@robertcollins.net-20080408041308-lfbh0gmvwfhc53yx
 * ``VersionedFile.clone_text`` is deprecated. This performance optimisation
   is no longer used - reading the content of a file that is undergoing a
   file level merge to identical state on two branches is rare enough, and
   not expensive enough to special case. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
359
359
        self.assertRaises(errors.OutSideTransaction, f.add_lines, '', [], [])
360
360
        self.assertRaises(errors.OutSideTransaction, f.add_lines_with_ghosts, '', [], [])
361
361
        self.assertRaises(errors.OutSideTransaction, f.join, '')
362
 
        self.assertRaises(errors.OutSideTransaction, f.clone_text, 'base', 'bar', ['foo'])
363
362
        
364
363
    def test_clear_cache(self):
365
364
        f = self.get_file()
373
372
    def test_clone_text(self):
374
373
        f = self.get_file()
375
374
        f.add_lines('r0', [], ['a\n', 'b\n'])
376
 
        f.clone_text('r1', 'r0', ['r0'])
 
375
        self.applyDeprecated(one_four, f.clone_text, 'r1', 'r0', ['r0'])
377
376
        def verify_file(f):
378
377
            self.assertEquals(f.get_lines('r1'), f.get_lines('r0'))
379
378
            self.assertEquals(f.get_lines('r1'), ['a\n', 'b\n'])
380
379
            self.assertEqual({'r1':('r0',)}, f.get_parent_map(['r1']))
381
380
            self.assertRaises(RevisionNotPresent,
382
 
                f.clone_text, 'r2', 'rX', [])
 
381
                self.applyDeprecated, one_four, f.clone_text, 'r2', 'rX', [])
383
382
            self.assertRaises(RevisionAlreadyPresent,
384
 
                f.clone_text, 'r1', 'r0', [])
 
383
                self.applyDeprecated, one_four, f.clone_text, 'r1', 'r0', [])
385
384
        verify_file(f)
386
385
        verify_file(self.reopen_file())
387
386
 
704
703
                          [],
705
704
                          [])
706
705
        self.assertRaises(errors.ReadOnlyError, vf.join, 'base')
707
 
        self.assertRaises(errors.ReadOnlyError, vf.clone_text, 'base', 'bar', ['foo'])
708
706
    
709
707
    def test_get_sha1s(self):
710
708
        # check the sha1 data is available