233
232
"""See `Tree.has_versioned_directories`."""
234
233
return self._format.supports_versioned_directories
235
def _supports_executable(self):
236
if sys.platform == 'win32':
238
# FIXME: Ideally this should check the file system
236
241
def break_lock(self):
237
242
"""Break a lock if one is present from another instance.
1118
1123
mode = stat_value.st_mode
1119
1124
kind = osutils.file_kind_from_stat_mode(mode)
1120
if not supports_executable():
1125
if not self._supports_executable():
1121
1126
executable = entry is not None and entry.executable
1123
1128
executable = bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
2192
2197
mode = stat_result.st_mode
2193
2198
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
2195
if not supports_executable():
2196
def is_executable(self, file_id, path=None):
2200
def is_executable(self, file_id, path=None):
2201
if not self._supports_executable():
2197
2202
return self._inventory[file_id].executable
2199
_is_executable_from_path_and_stat = \
2200
_is_executable_from_path_and_stat_from_basis
2202
def is_executable(self, file_id, path=None):
2204
2205
path = self.id2path(file_id)
2205
2206
mode = os.lstat(self.abspath(path)).st_mode
2206
2207
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
2208
_is_executable_from_path_and_stat = \
2209
_is_executable_from_path_and_stat_from_stat
2209
def _is_executable_from_path_and_stat(self, path, stat_result):
2210
if not self._supports_executable():
2211
return self._is_executable_from_path_and_stat_from_basis(path, stat_result)
2213
return self._is_executable_from_path_and_stat_from_stat(path, stat_result)
2211
2215
@needs_tree_write_lock
2212
2216
def _add(self, files, ids, kinds):