~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.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:
152
152
        if ie.kind == "file":
153
153
            return ie.text_sha1
154
154
 
 
155
    def is_executable(self, file_id):
 
156
        return self._inventory[file_id].executable
 
157
 
155
158
    def has_filename(self, filename):
156
159
        return bool(self.inventory.path2id(filename))
157
160
 
280
283
            os.mkdir(fullpath)
281
284
        elif kind == 'file':
282
285
            pumpfile(tree.get_file(ie.file_id), file(fullpath, 'wb'))
 
286
            if tree.is_executable(ie.file_id):
 
287
                os.chmod(fullpath, 0755)
283
288
        elif kind == 'symlink':
284
289
            try:
285
290
                os.symlink(ie.symlink_target, fullpath)
350
355
                item.type = tarfile.REGTYPE
351
356
                fileobj = tree.get_file(ie.file_id)
352
357
                item.size = _find_file_size(fileobj)
353
 
                item.mode = 0644
 
358
                if tree.is_executable(ie.file_id):
 
359
                    item.mode = 0755
 
360
                else:
 
361
                    item.mode = 0644
354
362
            else:
355
363
                raise BzrError("don't know how to export {%s} of kind %r" %
356
364
                        (ie.file_id, ie.kind))