~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 03:39:43 UTC
  • mto: This revision was merged to the branch mainline in revision 3350.
  • Revision ID: robertc@robertcollins.net-20080408033943-ihbgs5wyqnh61bit
 * ``VersionedFile.get_sha1`` is deprecated, please use
   ``VersionedFile.get_sha1s``. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
        for version in multiparent.topo_iter(vf):
248
248
            mpdiff = vf.make_mpdiffs([version])[0]
249
249
            new_vf.add_mpdiffs([(version, vf.get_parent_map([version])[version],
250
 
                                 vf.get_sha1(version), mpdiff)])
 
250
                                 vf.get_sha1s([version])[0], mpdiff)])
251
251
            self.assertEqualDiff(vf.get_text(version),
252
252
                                 new_vf.get_text(version))
253
253
 
706
706
        self.assertRaises(errors.ReadOnlyError, vf.join, 'base')
707
707
        self.assertRaises(errors.ReadOnlyError, vf.clone_text, 'base', 'bar', ['foo'])
708
708
    
709
 
    def test_get_sha1(self):
 
709
    def test_get_sha1s(self):
710
710
        # check the sha1 data is available
711
711
        vf = self.get_file()
712
712
        # a simple file
715
715
        vf.add_lines('b', ['a'], ['a\n'])
716
716
        # a file differing only in last newline.
717
717
        vf.add_lines('c', [], ['a'])
718
 
        self.assertEqual(
719
 
            '3f786850e387550fdab836ed7e6dc881de23001b', vf.get_sha1('a'))
720
 
        self.assertEqual(
721
 
            '3f786850e387550fdab836ed7e6dc881de23001b', vf.get_sha1('b'))
722
 
        self.assertEqual(
723
 
            '86f7e437faa5a7fce15d1ddcb9eaeaea377667b8', vf.get_sha1('c'))
724
 
 
 
718
        # Deprecasted single-version API.
 
719
        self.assertEqual(
 
720
            '3f786850e387550fdab836ed7e6dc881de23001b',
 
721
            self.applyDeprecated(one_four, vf.get_sha1, 'a'))
 
722
        self.assertEqual(
 
723
            '3f786850e387550fdab836ed7e6dc881de23001b',
 
724
            self.applyDeprecated(one_four, vf.get_sha1, 'b'))
 
725
        self.assertEqual(
 
726
            '86f7e437faa5a7fce15d1ddcb9eaeaea377667b8',
 
727
            self.applyDeprecated(one_four, vf.get_sha1, 'c'))
725
728
        self.assertEqual(['3f786850e387550fdab836ed7e6dc881de23001b',
726
729
                          '86f7e437faa5a7fce15d1ddcb9eaeaea377667b8',
727
730
                          '3f786850e387550fdab836ed7e6dc881de23001b'],