/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Vincent Ladeuil
  • Date: 2011-05-30 13:17:48 UTC
  • mto: (5743.9.4 config-lock-branch)
  • mto: This revision was merged to the branch mainline in revision 5941.
  • Revision ID: v.ladeuil+lp@free.fr-20110530131748-ukk0e2sj0xjk63ha
Address poolie's review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2162
2162
        before_writing = threading.Event()
2163
2163
        after_writing = threading.Event()
2164
2164
        writing_done = threading.Event()
2165
 
        c1_save_orig = c1.store._save
2166
 
        def c1_save():
 
2165
        c1_save_without_locking_orig = c1.store.save_without_locking
 
2166
        def c1_save_without_locking():
2167
2167
            before_writing.set()
2168
 
            c1_save_orig()
 
2168
            c1_save_without_locking_orig()
2169
2169
            # The lock is held. We wait for the main thread to decide when to
2170
2170
            # continue
2171
2171
            after_writing.wait()
2172
 
        c1.store._save = c1_save
 
2172
        c1.store.save_without_locking = c1_save_without_locking
2173
2173
        def c1_set():
2174
2174
            c1.set('one', 'c1')
2175
2175
            writing_done.set()
2197
2197
       do_writing = threading.Event()
2198
2198
       writing_done = threading.Event()
2199
2199
       # We override the _save implementation so we know the store is locked
2200
 
       c1_orig = c1.store._save
2201
 
       def c1_save():
 
2200
       c1_save_without_locking_orig = c1.store.save_without_locking
 
2201
       def c1_save_without_locking():
2202
2202
           ready_to_write.set()
2203
2203
           # The lock is held. We wait for the main thread to decide when to
2204
2204
           # continue
2205
2205
           do_writing.wait()
2206
 
           c1_orig()
 
2206
           c1_save_without_locking_orig()
2207
2207
           writing_done.set()
2208
 
       c1.store._save = c1_save
 
2208
       c1.store.save_without_locking = c1_save_without_locking
2209
2209
       def c1_set():
2210
2210
           c1.set('one', 'c1')
2211
2211
       t1 = threading.Thread(target=c1_set)