Rev 5321: Duplicate configs partially communicate. in file:///home/vila/src/bzr/bugs/525571-lock-bazaar-conf-files/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Jun 28 09:56:03 BST 2010
At file:///home/vila/src/bzr/bugs/525571-lock-bazaar-conf-files/
------------------------------------------------------------
revno: 5321
revision-id: v.ladeuil+lp at free.fr-20100628085603-15lecj3pc3nduat6
parent: v.ladeuil+lp at free.fr-20100628085122-ln3uwaqztf4drt3i
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 525571-lock-bazaar-conf-files
timestamp: Mon 2010-06-28 10:56:03 +0200
message:
Duplicate configs partially communicate.
* bzrlib/tests/test_config.py:
(TestLockableConfig.test_last_speaker_wins): Make it clear that
unshared configs can lead to divergent results.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2010-06-28 08:51:22 +0000
+++ b/bzrlib/tests/test_config.py 2010-06-28 08:56:03 +0000
@@ -430,6 +430,20 @@
# The second update respect the first one
self.assertEquals('ONE', c2._get_user_option('one'))
+ def test_last_speaker_wins(self):
+ # If the same config is not shared, the same variable modified twice
+ # can only see a single result.
+ c1 = self.config
+ c2 = self.create_config()
+ c1.set_user_option('one', 'c1')
+ c2.set_user_option('one', 'c2')
+ self.assertEquals('c2', c2._get_user_option('one'))
+ # The first modification is still available until another refresh
+ # occur
+ self.assertEquals('c1', c1._get_user_option('one'))
+ c1.set_user_option('two', 'done')
+ self.assertEquals('c2', c1._get_user_option('one'))
+
class TestGetUserOptionAs(TestIniConfig):
More information about the bazaar-commits
mailing list