~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Andrew Bennetts
  • Date: 2009-10-13 05:20:50 UTC
  • mfrom: (4634.52.16 2.0)
  • mto: This revision was merged to the branch mainline in revision 4738.
  • Revision ID: andrew.bennetts@canonical.com-20091013052050-u1w6tv0z7kqhn8d0
Merge 2.0 into lp:bzr, resolving conflicts in NEWS and releasing.txt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2201
2201
            repo.get_rev_id_for_revno, 5, (42, 'rev-foo'))
2202
2202
        self.assertFinished(client)
2203
2203
 
 
2204
    def test_branch_fallback_locking(self):
 
2205
        """RemoteBranch.get_rev_id takes a read lock, and tries to call the
 
2206
        get_rev_id_for_revno verb.  If the verb is unknown the VFS fallback
 
2207
        will be invoked, which will fail if the repo is unlocked.
 
2208
        """
 
2209
        self.setup_smart_server_with_call_log()
 
2210
        tree = self.make_branch_and_memory_tree('.')
 
2211
        tree.lock_write()
 
2212
        rev1 = tree.commit('First')
 
2213
        rev2 = tree.commit('Second')
 
2214
        tree.unlock()
 
2215
        branch = tree.branch
 
2216
        self.assertFalse(branch.is_locked())
 
2217
        self.reset_smart_call_log()
 
2218
        verb = 'Repository.get_rev_id_for_revno'
 
2219
        self.disable_verb(verb)
 
2220
        self.assertEqual(rev1, branch.get_rev_id(1))
 
2221
        self.assertLength(1, [call for call in self.hpss_calls if
 
2222
                              call.call.method == verb])
 
2223
 
2204
2224
 
2205
2225
class TestRepositoryIsShared(TestRemoteRepository):
2206
2226