~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Martin Pool
  • Date: 2007-10-08 09:17:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2899.
  • Revision ID: mbp@sourcefrog.net-20071008091737-lbed3avpxvwsbeoh
Fix comparison for merge sort in Dirstate.set_state_from_inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
700
700
            # This will unlock it
701
701
            self.check_state_with_reopen(expected_result, state)
702
702
 
703
 
    def test_set_state_from_inventory_preserves_hashcahche(self):
 
703
    def test_set_state_from_inventory_preserves_hashcache(self):
704
704
        # https://bugs.edge.launchpad.net/bzr/+bug/146176
705
705
        # set_state_from_inventory should preserve the stat and hash value for
706
706
        # workingtree files that are not changed by the inventory.
738
738
           
739
739
            # extract the inventory, and add something to it
740
740
            inv = tree._get_inventory()
 
741
            # should see the file we poked in...
 
742
            self.assertTrue(inv.has_id('foo-id'))
 
743
            self.assertTrue(inv.has_filename('foo'))
741
744
            inv.add_path('bar', 'file', 'bar-id')
742
745
            # no-op change is enough to make it lose state
743
746
            tree._dirstate.set_state_from_inventory(inv)
749
752
            # now check that the state still has the original hashcache value
750
753
            state = tree._dirstate
751
754
            foo_tuple = state._get_entry(0, path_utf8='foo')
752
 
            self.expectFailure(
753
 
                'set_state_from_inventory clears hashcache (#146176)',
754
 
                self.assertEqual,
 
755
            ## self.expectFailure(
 
756
                ## 'set_state_from_inventory clears hashcache (#146176)',
 
757
            self.assertEqual(
755
758
                (('', 'foo', 'foo-id',),
756
759
                 [('f', foo_sha, len(foo_contents), False,
757
760
                   dirstate.pack_stat(foo_stat))]),