Rev 5334: Clarify lock scope. in file:///home/vila/src/bzr/bugs/525571-lock-bazaar-conf-files/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Jul 2 15:50:58 BST 2010


At file:///home/vila/src/bzr/bugs/525571-lock-bazaar-conf-files/

------------------------------------------------------------
revno: 5334
revision-id: v.ladeuil+lp at free.fr-20100702145058-jdy98i7fbb8ectcb
parent: v.ladeuil+lp at free.fr-20100630145307-kivkluj078vsl07d
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 525571-lock-bazaar-conf-files
timestamp: Fri 2010-07-02 16:50:58 +0200
message:
  Clarify lock scope.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2010-06-30 14:53:07 +0000
+++ b/bzrlib/config.py	2010-07-02 14:50:58 +0000
@@ -521,8 +521,10 @@
     ``@needs_write_lock`` decorator (they call, directly or indirectly, the
     ``_write_config_file()`` method. These methods (typically ``set_option()``
     and variants must reload the config file from disk before calling
-    ``_write_config_file()``, this can be achieved by calling the
-    ``self.reload()`` method.
+    ``_write_config_file()``), this can be achieved by calling the
+    ``self.reload()`` method. Note that the lock scope should cover both the
+    reading and the writing of the config file which is why the decorator can't
+    be applied to ``_write_config_file()`` only.
 
     This should be enough to implement the following logic:
     - lock for exclusive write access,



More information about the bazaar-commits mailing list