~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

(jameinel) Properly save ``branch.conf`` changes when unlocking a
 BzrBranch4. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2437
2437
        """
2438
2438
        if not self.is_locked():
2439
2439
            self._note_lock('w')
2440
 
        # All-in-one needs to always unlock/lock.
2441
 
        repo_control = getattr(self.repository, 'control_files', None)
2442
 
        if self.control_files == repo_control or not self.is_locked():
2443
2440
            self.repository._warn_if_deprecated(self)
2444
2441
            self.repository.lock_write()
2445
2442
            took_lock = True
2460
2457
        """
2461
2458
        if not self.is_locked():
2462
2459
            self._note_lock('r')
2463
 
        # All-in-one needs to always unlock/lock.
2464
 
        repo_control = getattr(self.repository, 'control_files', None)
2465
 
        if self.control_files == repo_control or not self.is_locked():
2466
2460
            self.repository._warn_if_deprecated(self)
2467
2461
            self.repository.lock_read()
2468
2462
            took_lock = True
2483
2477
        try:
2484
2478
            self.control_files.unlock()
2485
2479
        finally:
2486
 
            # All-in-one needs to always unlock/lock.
2487
 
            repo_control = getattr(self.repository, 'control_files', None)
2488
 
            if (self.control_files == repo_control or
2489
 
                not self.control_files.is_locked()):
2490
 
                self.repository.unlock()
2491
2480
            if not self.control_files.is_locked():
 
2481
                self.repository.unlock()
2492
2482
                # we just released the lock
2493
2483
                self._clear_cached_state()
2494
2484