~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-07 05:33:23 UTC
  • mto: (4634.52.14 2.0)
  • mto: This revision was merged to the branch mainline in revision 4738.
  • Revision ID: andrew.bennetts@canonical.com-20091007053323-1uyaywnh3k8f3zoe
Apply @needs_read_lock to RemoteBranch.get_rev_id.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2147
2147
            repo.get_rev_id_for_revno, 5, (42, 'rev-foo'))
2148
2148
        self.assertFinished(client)
2149
2149
 
 
2150
    def test_branch_fallback_locking(self):
 
2151
        """RemoteBranch.get_rev_id takes a read lock, and tries to call the
 
2152
        get_rev_id_for_revno verb.  If the verb is unknown the VFS fallback
 
2153
        will be invoked, which will fail if the repo is unlocked.
 
2154
        """
 
2155
        self.setup_smart_server_with_call_log()
 
2156
        tree = self.make_branch_and_memory_tree('.')
 
2157
        tree.lock_write()
 
2158
        rev1 = tree.commit('First')
 
2159
        rev2 = tree.commit('Second')
 
2160
        tree.unlock()
 
2161
        branch = tree.branch
 
2162
        self.assertFalse(branch.is_locked())
 
2163
        self.reset_smart_call_log()
 
2164
        verb = 'Repository.get_rev_id_for_revno'
 
2165
        self.disable_verb(verb)
 
2166
        self.assertEqual(rev1, branch.get_rev_id(1))
 
2167
        self.assertLength(1, [call for call in self.hpss_calls if
 
2168
                              call.call.method == verb])
 
2169
 
2150
2170
 
2151
2171
class TestRepositoryIsShared(TestRemoteRepository):
2152
2172