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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-19 17:00:10 UTC
  • mfrom: (2911.5.4 dirstate_error_149113)
  • Revision ID: pqm@pqm.ubuntu.com-20071019170010-qyc4akzhu3rdko4b
(John Arbash Meinel) Fix bug #149113 by always returning True/False from path_content_summary for files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
599
599
            path = self.inventory.id2path(file_id)
600
600
        return os.lstat(self.abspath(path)).st_mtime
601
601
 
 
602
    def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
 
603
        file_id = self.path2id(path)
 
604
        return self._inventory[file_id].executable
 
605
 
 
606
    def _is_executable_from_path_and_stat_from_stat(self, path, stat_result):
 
607
        mode = stat_result.st_mode
 
608
        return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
 
609
 
602
610
    if not supports_executable():
603
611
        def is_executable(self, file_id, path=None):
604
612
            return self._inventory[file_id].executable
 
613
 
 
614
        _is_executable_from_path_and_stat = \
 
615
            _is_executable_from_path_and_stat_from_basis
605
616
    else:
606
617
        def is_executable(self, file_id, path=None):
607
618
            if not path:
609
620
            mode = os.lstat(self.abspath(path)).st_mode
610
621
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
611
622
 
 
623
        _is_executable_from_path_and_stat = \
 
624
            _is_executable_from_path_and_stat_from_stat
 
625
 
612
626
    @needs_tree_write_lock
613
627
    def _add(self, files, ids, kinds):
614
628
        """See MutableTree._add."""
705
719
        if kind == 'file':
706
720
            size = stat_result.st_size
707
721
            # try for a stat cache lookup
708
 
            if not supports_executable():
709
 
                executable = None # caller can decide policy.
710
 
            else:
711
 
                mode = stat_result.st_mode
712
 
                executable = bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
 
722
            executable = self._is_executable_from_path_and_stat(path, stat_result)
713
723
            return (kind, size, executable, self._sha_from_stat(
714
724
                path, stat_result))
715
725
        elif kind == 'directory':