/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 bzrlib/workingtree_4.py

  • Committer: Alexander Belchenko
  • Date: 2008-02-28 21:25:30 UTC
  • mfrom: (3243 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3246.
  • Revision ID: bialix@ukr.net-20080228212530-pcrt1sc4vcezapgr
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
500
500
            mode = os.lstat(self.abspath(path)).st_mode
501
501
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
502
502
 
 
503
    def all_file_ids(self):
 
504
        """See Tree.iter_all_file_ids"""
 
505
        self._must_be_locked()
 
506
        result = set()
 
507
        for key, tree_details in self.current_dirstate()._iter_entries():
 
508
            if tree_details[0][0] in ('a', 'r'): # relocated
 
509
                continue
 
510
            result.add(key[2])
 
511
        return result
 
512
 
503
513
    @needs_read_lock
504
514
    def __iter__(self):
505
515
        """Iterate through file_ids for this tree.
1215
1225
            for file_id in file_ids:
1216
1226
                self._inventory.remove_recursive_id(file_id)
1217
1227
 
 
1228
    @needs_tree_write_lock
 
1229
    def rename_one(self, from_rel, to_rel, after=False):
 
1230
        """See WorkingTree.rename_one"""
 
1231
        self.flush()
 
1232
        WorkingTree.rename_one(self, from_rel, to_rel, after)
 
1233
 
 
1234
    @needs_tree_write_lock
 
1235
    def apply_inventory_delta(self, changes):
 
1236
        """See MutableTree.apply_inventory_delta"""
 
1237
        state = self.current_dirstate()
 
1238
        state.update_by_delta(changes)
 
1239
        self._make_dirty(reset_inventory=True)
 
1240
 
1218
1241
    def update_basis_by_delta(self, new_revid, delta):
1219
1242
        """See MutableTree.update_basis_by_delta."""
1220
1243
        assert self.last_revision() != new_revid
1259
1282
        return "Working tree format 4"
1260
1283
 
1261
1284
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
1262
 
                   accelerator_tree=None):
 
1285
                   accelerator_tree=None, hardlink=False):
1263
1286
        """See WorkingTreeFormat.initialize().
1264
1287
 
1265
1288
        :param revision_id: allows creating a working tree at a different
1268
1291
            contents more quickly than the revision tree, i.e. a workingtree.
1269
1292
            The revision tree will be used for cases where accelerator_tree's
1270
1293
            content is different.
 
1294
        :param hardlink: If true, hard-link files from accelerator_tree,
 
1295
            where possible.
1271
1296
 
1272
1297
        These trees get an initial random root id, if their repository supports
1273
1298
        rich root data, TREE_ROOT otherwise.
1320
1345
            else:
1321
1346
                parents_list = [(revision_id, basis)]
1322
1347
            basis.lock_read()
1323
 
            wt.set_parent_trees(parents_list, allow_leftmost_as_ghost=True)
1324
 
            wt.flush()
1325
 
            # if the basis has a root id we have to use that; otherwise we use
1326
 
            # a new random one
1327
 
            basis_root_id = basis.get_root_id()
1328
 
            if basis_root_id is not None:
1329
 
                wt._set_root_id(basis_root_id)
 
1348
            try:
 
1349
                wt.set_parent_trees(parents_list, allow_leftmost_as_ghost=True)
1330
1350
                wt.flush()
1331
 
            transform.build_tree(basis, wt, accelerator_tree)
1332
 
            basis.unlock()
 
1351
                # if the basis has a root id we have to use that; otherwise we
 
1352
                # use a new random one
 
1353
                basis_root_id = basis.get_root_id()
 
1354
                if basis_root_id is not None:
 
1355
                    wt._set_root_id(basis_root_id)
 
1356
                    wt.flush()
 
1357
                transform.build_tree(basis, wt, accelerator_tree,
 
1358
                                     hardlink=hardlink)
 
1359
            finally:
 
1360
                basis.unlock()
1333
1361
        finally:
1334
1362
            control_files.unlock()
1335
1363
            wt.unlock()
1602
1630
            raise errors.NoSuchId(tree=self, file_id=file_id)
1603
1631
        return dirstate.DirState._minikind_to_kind[entry[1][0]]
1604
1632
 
 
1633
    def stored_kind(self, file_id):
 
1634
        """See Tree.stored_kind"""
 
1635
        return self.kind(file_id)
 
1636
 
1605
1637
    def path_content_summary(self, path):
1606
1638
        """See Tree.path_content_summary."""
1607
1639
        id = self.inventory.path2id(path)