~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Ian Clatworthy
  • Date: 2007-06-06 06:11:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2513.
  • Revision ID: ian.clatworthy@internode.on.net-20070606061158-zbwatmjd2m1p474g
remove implicit read locks for kind() and is_executable() in wt4

Show diffs side-by-side

added added

removed removed

Lines of Context:
472
472
 
473
473
    @needs_read_lock
474
474
    def id2path(self, file_id):
 
475
        "Convert a file-id to a path."
475
476
        file_id = osutils.safe_file_id(file_id)
476
477
        state = self.current_dirstate()
477
478
        entry = self._get_entry(file_id=file_id)
481
482
        return path_utf8.decode('utf8')
482
483
 
483
484
    if not osutils.supports_executable():
484
 
        @needs_read_lock
485
485
        def is_executable(self, file_id, path=None):
 
486
            """Test if a file is executable or not.
 
487
 
 
488
            Note: The caller is expected to take a read-lock before calling this.
 
489
            """
486
490
            file_id = osutils.safe_file_id(file_id)
487
491
            entry = self._get_entry(file_id=file_id, path=path)
488
492
            if entry == (None, None):
489
493
                return False
490
494
            return entry[1][0][3]
491
495
    else:
492
 
        @needs_read_lock
493
496
        def is_executable(self, file_id, path=None):
 
497
            """Test if a file is executable or not.
 
498
 
 
499
            Note: The caller is expected to take a read-lock before calling this.
 
500
            """
494
501
            if not path:
495
502
                file_id = osutils.safe_file_id(file_id)
496
503
                path = self.id2path(file_id)
530
537
                # path is missing on disk.
531
538
                continue
532
539
 
533
 
    @needs_read_lock
534
540
    def kind(self, file_id):
535
541
        """Return the kind of a file.
536
542
 
537
543
        This is always the actual kind that's on disk, regardless of what it
538
544
        was added as.
 
545
 
 
546
        Note: The caller is expected to take a read-lock before calling this.
539
547
        """
540
548
        relpath = self.id2path(file_id)
541
549
        assert relpath != None, \