~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2012-07-06 11:27:16 UTC
  • mfrom: (6534 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6535.
  • Revision ID: jelmer@samba.org-20120706112716-jcun7vvbpgmcplgz
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2398
2398
        """
2399
2399
        if not self.is_locked():
2400
2400
            self._note_lock('w')
2401
 
        # All-in-one needs to always unlock/lock.
2402
 
        repo_control = getattr(self.repository, 'control_files', None)
2403
 
        if self.control_files == repo_control or not self.is_locked():
2404
2401
            self.repository._warn_if_deprecated(self)
2405
2402
            self.repository.lock_write()
2406
2403
            took_lock = True
2421
2418
        """
2422
2419
        if not self.is_locked():
2423
2420
            self._note_lock('r')
2424
 
        # All-in-one needs to always unlock/lock.
2425
 
        repo_control = getattr(self.repository, 'control_files', None)
2426
 
        if self.control_files == repo_control or not self.is_locked():
2427
2421
            self.repository._warn_if_deprecated(self)
2428
2422
            self.repository.lock_read()
2429
2423
            took_lock = True
2444
2438
        try:
2445
2439
            self.control_files.unlock()
2446
2440
        finally:
2447
 
            # All-in-one needs to always unlock/lock.
2448
 
            repo_control = getattr(self.repository, 'control_files', None)
2449
 
            if (self.control_files == repo_control or
2450
 
                not self.control_files.is_locked()):
2451
 
                self.repository.unlock()
2452
2441
            if not self.control_files.is_locked():
 
2442
                self.repository.unlock()
2453
2443
                # we just released the lock
2454
2444
                self._clear_cached_state()
2455
2445