~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_readonly.py

merge dirstate

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        # test so that they pass. For now, we just assert that we have the
90
90
        # right type of objects available.
91
91
        the_hashcache = getattr(tree, '_hashcache', None)
92
 
        self.assertNotEqual(None, the_hashcache)
93
 
        self.assertIsInstance(the_hashcache, hashcache.HashCache)
94
 
        the_hashcache._cutoff_time = self._custom_cutoff_time
 
92
        if the_hashcache is not None:
 
93
            self.assertIsInstance(the_hashcache, hashcache.HashCache)
 
94
            the_hashcache._cutoff_time = self._custom_cutoff_time
 
95
            hack_dirstate = False
 
96
        else:
 
97
            # DirState trees don't have a HashCache, but they do have the same
 
98
            # function as part of the DirState. However, until the tree is
 
99
            # locked, we don't have a DirState to modify
 
100
            hack_dirstate = True
95
101
 
96
102
        # Make it a little dirty
97
103
        self.build_tree_contents([('tree/a', 'new contents of a\n')])
101
107
 
102
108
        tree.lock_read()
103
109
        try:
 
110
            if hack_dirstate:
 
111
                tree._dirstate._sha_cutoff_time = self._custom_cutoff_time
104
112
            # Make sure we check all the files
105
113
            for file_id in tree:
106
114
                size = tree.get_file_size(file_id)