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

Dirstate - truncate state file fixing bug in saving a smaller file, get more tree_implementation tests passing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
592
592
    else:
593
593
        def is_executable(self, file_id, path=None):
594
594
            if not path:
595
 
                path = self._inventory.id2path(file_id)
 
595
                path = self.id2path(file_id)
596
596
            mode = os.lstat(self.abspath(path)).st_mode
597
597
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
598
598
 
1266
1266
        These are files in the working directory that are not versioned or
1267
1267
        control files or ignored.
1268
1268
        """
1269
 
        for subp in self.extras():
1270
 
            if not self.is_ignored(subp):
1271
 
                yield subp
 
1269
        # force the extras method to be fully executed before returning, to 
 
1270
        # prevent race conditions with the lock
 
1271
        return iter(
 
1272
            [subp for subp in self.extras() if not self.is_ignored(subp)])
1272
1273
    
1273
1274
    @needs_tree_write_lock
1274
1275
    def unversion(self, file_ids):
1406
1407
                subp = pathjoin(path, subf)
1407
1408
                yield subp
1408
1409
 
1409
 
 
1410
1410
    def ignored_files(self):
1411
1411
        """Yield list of PATH, IGNORE_PATTERN"""
1412
1412
        for subp in self.extras():
1729
1729
                DeprecationWarning,
1730
1730
                stacklevel=3)
1731
1731
            file_id = ROOT_ID
 
1732
        self._set_root_id(file_id)
 
1733
 
 
1734
    def _set_root_id(self, file_id):
 
1735
        """Set the root id for this tree, in a format specific manner.
 
1736
 
 
1737
        :param file_id: The file id to assign to the root. It must not be 
 
1738
            present in the current inventory or an error will occur. It must
 
1739
            not be None, but rather a valid file id.
 
1740
        """
1732
1741
        inv = self._inventory
1733
1742
        orig_root_id = inv.root.file_id
1734
1743
        # TODO: it might be nice to exit early if there was nothing