~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Andrew Bennetts
  • Date: 2007-04-12 16:22:21 UTC
  • mto: (2018.18.11 hpss-faster-copy)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20070412162221-6imfutzivlmg4rg5
Fix four tests I broke with the Branch.lock_write changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
        backing = self.get_transport()
284
284
        request = smart.branch.SmartServerBranchRequestSetLastRevision(backing)
285
285
        b = self.make_branch('.')
286
 
        branch_token, repo_token = b.lock_write()
 
286
        branch_token = b.lock_write()
 
287
        repo_token = b.repository.lock_write()
 
288
        b.repository.unlock()
287
289
        try:
288
290
            self.assertEqual(SmartServerResponse(('ok',)),
289
291
                request.execute(
295
297
        backing = self.get_transport()
296
298
        request = smart.branch.SmartServerBranchRequestSetLastRevision(backing)
297
299
        b = self.make_branch('.')
298
 
        branch_token, repo_token = b.lock_write()
 
300
        branch_token = b.lock_write()
 
301
        repo_token = b.repository.lock_write()
 
302
        b.repository.unlock()
299
303
        try:
300
304
            revision_id = 'non-existent revision'
301
305
            self.assertEqual(
317
321
        r1 = tree.commit('1st commit', rev_id=rev_id)
318
322
        r2 = tree.commit('2nd commit')
319
323
        tree.unlock()
320
 
        branch_token, repo_token = tree.branch.lock_write()
 
324
        branch_token = tree.branch.lock_write()
 
325
        repo_token = tree.branch.repository.lock_write()
 
326
        tree.branch.repository.unlock()
321
327
        try:
322
328
            self.assertEqual(
323
329
                SmartServerResponse(('ok',)),
340
346
        r2 = tree.commit('2nd commit')
341
347
        tree.unlock()
342
348
        tree.branch.set_revision_history([])
343
 
        branch_token, repo_token = tree.branch.lock_write()
 
349
        branch_token = tree.branch.lock_write()
 
350
        repo_token = tree.branch.repository.lock_write()
 
351
        tree.branch.repository.unlock()
344
352
        try:
345
353
            self.assertEqual(
346
354
                SmartServerResponse(('ok',)),