~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2006-05-27 08:19:40 UTC
  • mto: (1711.2.26 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1734.
  • Revision ID: john@arbash-meinel.com-20060527081940-b9b872d50743430b
If you have the path, use it rather than looking it up again

Show diffs side-by-side

added added

removed removed

Lines of Context:
530
530
        return os.path.getsize(self.id2abspath(file_id))
531
531
 
532
532
    @needs_read_lock
533
 
    def get_file_sha1(self, file_id):
534
 
        path = self._inventory.id2path(file_id)
 
533
    def get_file_sha1(self, file_id, path=None):
 
534
        if not path:
 
535
            path = self._inventory.id2path(file_id)
535
536
        return self._hashcache.get_sha1(path)
536
537
 
537
 
    def is_executable(self, file_id):
538
 
        if not supports_executable():
 
538
    if not supports_executable():
 
539
        def is_executable(self, file_id, path=None):
539
540
            return self._inventory[file_id].executable
540
 
        else:
541
 
            path = self._inventory.id2path(file_id)
 
541
    else:
 
542
        def is_executable(self, file_id, path=None):
 
543
            if not path:
 
544
                path = self._inventory.id2path(file_id)
542
545
            mode = os.lstat(self.abspath(path)).st_mode
543
546
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC&mode)
544
547