~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 16:28:30 UTC
  • mto: This revision was merged to the branch mainline in revision 6512.
  • Revision ID: v.ladeuil+lp@free.fr-20120313162830-83ekrd4ghqru0whh
Save branch config options only during the final unlock

Show diffs side-by-side

added added

removed removed

Lines of Context:
986
986
        This means the next call to revision_history will need to call
987
987
        _gen_revision_history.
988
988
 
989
 
        This API is semi-public; it only for use by subclasses, all other code
990
 
        should consider it to be private.
 
989
        This API is semi-public; it is only for use by subclasses, all other
 
990
        code should consider it to be private.
991
991
        """
992
992
        self._revision_history_cache = None
993
993
        self._revision_id_to_revno_cache = None
2560
2560
 
2561
2561
    @only_raises(errors.LockNotHeld, errors.LockBroken)
2562
2562
    def unlock(self):
2563
 
        if self.conf_store is not None:
 
2563
        if self.control_files._lock_count == 1 and self.conf_store is not None:
2564
2564
            self.conf_store.save_changes()
2565
2565
        try:
2566
2566
            self.control_files.unlock()