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

  • Committer: Jelmer Vernooij
  • Date: 2018-03-06 01:46:14 UTC
  • mfrom: (0.200.1819 work)
  • mto: (0.200.1820 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180306014614-w4yooagw6ufouzf4
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    commit_tree,
37
37
    index_entry_from_stat,
38
38
    iter_fresh_blobs,
 
39
    blob_from_path_and_stat,
39
40
    )
40
41
from dulwich.object_store import (
41
42
    tree_lookup_path,
839
840
        mode = stat_result.st_mode
840
841
        return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
841
842
 
 
843
    def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
 
844
        return self.basis_tree().is_executable(path)
 
845
 
842
846
    def stored_kind(self, path, file_id=None):
843
847
        with self.lock_read():
844
848
            try:
852
856
    def is_executable(self, path, file_id=None):
853
857
        if getattr(self, "_supports_executable", osutils.supports_executable)():
854
858
            mode = os.lstat(self.abspath(path)).st_mode
855
 
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
856
859
        else:
857
 
            basis_tree = self.basis_tree()
858
 
            if file_id in basis_tree:
859
 
                return basis_tree.is_executable(path, file_id)
860
 
            # Default to not executable
861
 
            return False
 
860
            try:
 
861
                mode = self.index[path.encode('utf-8')].mode
 
862
            except KeyError:
 
863
                mode = 0
 
864
        return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
862
865
 
863
866
    def _is_executable_from_path_and_stat(self, path, stat_result):
864
867
        if getattr(self, "_supports_executable", osutils.supports_executable)():
1011
1014
                (parent, name) = posixpath.split(path)
1012
1015
                try:
1013
1016
                    file_ie = self._get_file_ie(name, path, value, None)
1014
 
                except IOError:
 
1017
                except errors.NoSuchFile:
1015
1018
                    continue
1016
1019
                if yield_parents or specific_file_ids is None:
1017
1020
                    for (dir_path, dir_ie) in self._add_missing_parent_ids(parent,
1399
1402
        except UnicodeDecodeError:
1400
1403
            raise errors.BadFilenameEncoding(
1401
1404
                e, osutils._fs_enc)
1402
 
        yield (np, st.st_mode,
1403
 
               blob_from_path_and_stat(ap, st).id)
 
1405
        yield ((None, np), (None, st.st_mode),
 
1406
               (None, blob_from_path_and_stat(ap.encode('utf-8'), st).id))
1404
1407
 
1405
1408
 
1406
1409
def changes_between_git_tree_and_index(store, from_tree_sha, target,