~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2009-04-15 07:30:34 UTC
  • mto: This revision was merged to the branch mainline in revision 4292.
  • Revision ID: robertc@robertcollins.net-20090415073034-plcl46p8poz08kzb
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1930
1930
        return self.control_files.is_locked()
1931
1931
 
1932
1932
    def lock_write(self, token=None):
 
1933
        # All-in-one needs to always unlock/lock.
1933
1934
        repo_control = getattr(self.repository, 'control_files', None)
1934
1935
        if self.control_files == repo_control or not self.is_locked():
1935
1936
            self.repository.lock_write()
1944
1945
            raise
1945
1946
 
1946
1947
    def lock_read(self):
 
1948
        # All-in-one needs to always unlock/lock.
1947
1949
        repo_control = getattr(self.repository, 'control_files', None)
1948
1950
        if self.control_files == repo_control or not self.is_locked():
1949
1951
            self.repository.lock_read()
1961
1963
        try:
1962
1964
            self.control_files.unlock()
1963
1965
        finally:
 
1966
            # All-in-one needs to always unlock/lock.
1964
1967
            repo_control = getattr(self.repository, 'control_files', None)
1965
1968
            if (self.control_files == repo_control or
1966
1969
                not self.control_files.is_locked()):