~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2005-10-03 01:42:16 UTC
  • Revision ID: robertc@robertcollins.net-20051003014215-ee2990904cc4c7ad
integrate in Gustavos x-bit patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# it's not predictable when it will be written out.
22
22
 
23
23
import os
 
24
import stat
24
25
import fnmatch
25
26
        
26
27
import bzrlib.tree
119
120
        path = self._inventory.id2path(file_id)
120
121
        return self._hashcache.get_sha1(path)
121
122
 
 
123
 
 
124
    def is_executable(self, file_id):
 
125
        if os.name == "nt":
 
126
            return self._inventory[file_id].executable
 
127
        else:
 
128
            path = self._inventory.id2path(file_id)
 
129
            mode = os.lstat(self.abspath(path)).st_mode
 
130
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC&mode)
 
131
 
122
132
    def get_symlink_target(self, file_id):
123
133
        return os.readlink(self.id2path(file_id))
124
134