~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-29 23:15:08 UTC
  • mto: This revision was merged to the branch mainline in revision 6464.
  • Revision ID: jelmer@samba.org-20111229231508-sy6h5nhkv0j5k2ex
Allow passing in tuples as file ids in various places.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2187
2187
            raise
2188
2188
 
2189
2189
    def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
2190
 
        file_id = self.path2id(path)
 
2190
        inv, file_id = self._path2inv_file_id(path)
2191
2191
        if file_id is None:
2192
2192
            # For unversioned files on win32, we just assume they are not
2193
2193
            # executable
2194
2194
            return False
2195
 
        return self._inventory[file_id].executable
 
2195
        return inv[file_id].executable
2196
2196
 
2197
2197
    def _is_executable_from_path_and_stat_from_stat(self, path, stat_result):
2198
2198
        mode = stat_result.st_mode
2200
2200
 
2201
2201
    def is_executable(self, file_id, path=None):
2202
2202
        if not self._supports_executable():
2203
 
            return self._inventory[file_id].executable
 
2203
            inv, inv_file_id = self._unpack_file_id(file_id)
 
2204
            return inv[inv_file_id].executable
2204
2205
        else:
2205
2206
            if not path:
2206
2207
                path = self.id2path(file_id)
2452
2453
        if not self.is_locked():
2453
2454
            raise errors.ObjectNotLocked(self)
2454
2455
 
2455
 
        inv = self.inventory
2456
2456
        if from_dir is None and include_root is True:
2457
 
            yield ('', 'V', 'directory', inv.root.file_id, inv.root)
 
2457
            yield ('', 'V', 'directory', self.inventory.root.file_id, self.inventory.root)
2458
2458
        # Convert these into local objects to save lookup times
2459
2459
        pathjoin = osutils.pathjoin
2460
2460
        file_kind = self._kind
2467
2467
 
2468
2468
        # directory file_id, relative path, absolute path, reverse sorted children
2469
2469
        if from_dir is not None:
2470
 
            from_dir_id = inv.path2id(from_dir)
 
2470
            inv, from_dir_id = self._path2inv_file_id(from_dir)
2471
2471
            if from_dir_id is None:
2472
2472
                # Directory not versioned
2473
2473
                return
2474
2474
            from_dir_abspath = pathjoin(self.basedir, from_dir)
2475
2475
        else:
 
2476
            inv = self.inventory
2476
2477
            from_dir_id = inv.root.file_id
2477
2478
            from_dir_abspath = self.basedir
2478
2479
        children = os.listdir(from_dir_abspath)