/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_4.py

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
567
567
            return _mod_revision.NULL_REVISION
568
568
 
569
569
    def lock_read(self):
570
 
        """See Branch.lock_read, and WorkingTree.unlock.
571
 
 
572
 
        :return: An object with an unlock method which will release the lock
573
 
            obtained.
574
 
        """
 
570
        """See Branch.lock_read, and WorkingTree.unlock."""
575
571
        self.branch.lock_read()
576
572
        try:
577
573
            self._control_files.lock_read()
590
586
        except:
591
587
            self.branch.unlock()
592
588
            raise
593
 
        return self
594
589
 
595
590
    def _lock_self_write(self):
596
591
        """This should be called after the branch is locked."""
611
606
        except:
612
607
            self.branch.unlock()
613
608
            raise
614
 
        return self
615
609
 
616
610
    def lock_tree_write(self):
617
 
        """See MutableTree.lock_tree_write, and WorkingTree.unlock.
618
 
 
619
 
        :return: An object with an unlock method which will release the lock
620
 
            obtained.
621
 
        """
 
611
        """See MutableTree.lock_tree_write, and WorkingTree.unlock."""
622
612
        self.branch.lock_read()
623
 
        return self._lock_self_write()
 
613
        self._lock_self_write()
624
614
 
625
615
    def lock_write(self):
626
 
        """See MutableTree.lock_write, and WorkingTree.unlock.
627
 
 
628
 
        :return: An object with an unlock method which will release the lock
629
 
            obtained.
630
 
        """
 
616
        """See MutableTree.lock_write, and WorkingTree.unlock."""
631
617
        self.branch.lock_write()
632
 
        return self._lock_self_write()
 
618
        self._lock_self_write()
633
619
 
634
620
    @needs_tree_write_lock
635
621
    def move(self, from_paths, to_dir, after=False):
1873
1859
            return None
1874
1860
        return ie.executable
1875
1861
 
1876
 
    def is_locked(self):
1877
 
        return self._locked
1878
 
 
1879
1862
    def list_files(self, include_root=False, from_dir=None, recursive=True):
1880
1863
        # We use a standard implementation, because DirStateRevisionTree is
1881
1864
        # dealing with one of the parents of the current state
1894
1877
            yield path, 'V', entry.kind, entry.file_id, entry
1895
1878
 
1896
1879
    def lock_read(self):
1897
 
        """Lock the tree for a set of operations.
1898
 
 
1899
 
        :return: An object with an unlock method which will release the lock
1900
 
            obtained.
1901
 
        """
 
1880
        """Lock the tree for a set of operations."""
1902
1881
        if not self._locked:
1903
1882
            self._repository.lock_read()
1904
1883
            if self._dirstate._lock_token is None:
1905
1884
                self._dirstate.lock_read()
1906
1885
                self._dirstate_locked = True
1907
1886
        self._locked += 1
1908
 
        return self
1909
1887
 
1910
1888
    def _must_be_locked(self):
1911
1889
        if not self._locked: