/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test__dirstate_helpers.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1200
1200
        state, entry = self.get_state_with_a()
1201
1201
        self.build_tree(['a'])
1202
1202
 
1203
 
        # Make sure we are using the version of _is_executable that doesn't
1204
 
        # check the filesystem mode.
1205
 
        state._use_filesystem_for_exec = False
 
1203
        # Make sure we are using the win32 implementation of _is_executable
 
1204
        state._is_executable = state._is_executable_win32
1206
1205
 
1207
1206
        # The file on disk is not executable, but we are marking it as though
1208
 
        # it is. With _use_filesystem_for_exec disabled we ignore what is on
1209
 
        # disk.
 
1207
        # it is. With _is_executable_win32 we ignore what is on disk.
1210
1208
        entry[1][0] = (b'f', b'', 0, True, dirstate.DirState.NULLSTAT)
1211
1209
 
1212
1210
        stat_value = os.lstat('a')
1260
1258
        state._sha1_provider = UppercaseSHA1Provider()
1261
1259
        # If we used the standard provider, it would look like nothing has
1262
1260
        # changed
1263
 
        file_ids_changed = [change.file_id for change
 
1261
        file_ids_changed = [change[0] for change
1264
1262
                            in tree.iter_changes(tree.basis_tree())]
1265
1263
        self.assertEqual([b'a-file-id'], file_ids_changed)
1266
1264
 
1291
1289
        self.overrideAttr(dirstate, '_process_entry', self._process_entry)
1292
1290
 
1293
1291
    def assertChangedFileIds(self, expected, tree):
1294
 
        with tree.lock_read():
1295
 
            file_ids = [info.file_id for info
 
1292
        tree.lock_read()
 
1293
        try:
 
1294
            file_ids = [info[0] for info
1296
1295
                        in tree.iter_changes(tree.basis_tree())]
 
1296
        finally:
 
1297
            tree.unlock()
1297
1298
        self.assertEqual(sorted(expected), sorted(file_ids))
1298
1299
 
1299
1300
    def test_exceptions_raised(self):
1326
1327
        tree = self.make_branch_and_tree('tree')
1327
1328
        self.build_tree(['tree/file'])
1328
1329
        tree.add(['file'], [b'file-id'])
1329
 
        self.assertChangedFileIds([tree.path2id(''), b'file-id'], tree)
 
1330
        self.assertChangedFileIds([tree.get_root_id(), b'file-id'], tree)
1330
1331
        tree.commit('one')
1331
1332
        self.assertChangedFileIds([], tree)
1332
1333