~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-28 16:13:49 UTC
  • mfrom: (6499.2.3 948339-config-caching)
  • Revision ID: pqm@pqm.ubuntu.com-20120328161349-2gsc0g11fcu43hlc
(vila) Properly share mutable config sections and save the branch config
 only during the final unlock (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
968
968
        This means the next call to revision_history will need to call
969
969
        _gen_revision_history.
970
970
 
971
 
        This API is semi-public; it only for use by subclasses, all other code
972
 
        should consider it to be private.
 
971
        This API is semi-public; it is only for use by subclasses, all other
 
972
        code should consider it to be private.
973
973
        """
974
974
        self._revision_history_cache = None
975
975
        self._revision_id_to_revno_cache = None
2495
2495
 
2496
2496
    @only_raises(errors.LockNotHeld, errors.LockBroken)
2497
2497
    def unlock(self):
2498
 
        if self.conf_store is not None:
 
2498
        if self.control_files._lock_count == 1 and self.conf_store is not None:
2499
2499
            self.conf_store.save_changes()
2500
2500
        try:
2501
2501
            self.control_files.unlock()