73
# Explicitly import bzrlib.bzrdir so that the BzrProber
74
# is guaranteed to be registered.
72
77
from bzrlib import symbol_versioning
73
78
from bzrlib.decorators import needs_read_lock, needs_write_lock
74
79
from bzrlib.i18n import gettext
228
232
"""See `Tree.has_versioned_directories`."""
229
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
231
241
def break_lock(self):
232
242
"""Break a lock if one is present from another instance.
1113
1123
mode = stat_value.st_mode
1114
1124
kind = osutils.file_kind_from_stat_mode(mode)
1115
if not supports_executable():
1125
if not self._supports_executable():
1116
1126
executable = entry is not None and entry.executable
1118
1128
executable = bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
2187
2197
mode = stat_result.st_mode
2188
2198
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
2190
if not supports_executable():
2191
def is_executable(self, file_id, path=None):
2200
def is_executable(self, file_id, path=None):
2201
if not self._supports_executable():
2192
2202
return self._inventory[file_id].executable
2194
_is_executable_from_path_and_stat = \
2195
_is_executable_from_path_and_stat_from_basis
2197
def is_executable(self, file_id, path=None):
2199
2205
path = self.id2path(file_id)
2200
2206
mode = os.lstat(self.abspath(path)).st_mode
2201
2207
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
2203
_is_executable_from_path_and_stat = \
2204
_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)
2206
2215
@needs_tree_write_lock
2207
2216
def _add(self, files, ids, kinds):