~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Aaron Bentley
  • Date: 2008-12-03 05:09:44 UTC
  • mto: This revision was merged to the branch mainline in revision 3892.
  • Revision ID: aaron@aaronbentley.com-20081203050944-biuf61wbttr0wrzv
Allow miss caching to be disabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1236
1236
            repo.get_parent_map, ['a-revision-id'])
1237
1237
 
1238
1238
 
 
1239
class TestGetParentMapAllowsNew(tests.TestCaseWithTransport):
 
1240
 
 
1241
    def test_allows_new_revisions(self):
 
1242
        """get_parent_map's results can be updated by commit."""
 
1243
        smart_server = server.SmartTCPServer_for_testing()
 
1244
        smart_server.setUp()
 
1245
        self.addCleanup(smart_server.tearDown)
 
1246
        self.make_branch('branch')
 
1247
        branch = Branch.open(smart_server.get_url() + '/branch')
 
1248
        tree = branch.create_checkout('tree', lightweight=True)
 
1249
        tree.lock_write()
 
1250
        self.addCleanup(tree.unlock)
 
1251
        graph = tree.branch.repository.get_graph()
 
1252
        # This provides an opportunity for the missing rev-id to be cached.
 
1253
        self.assertEqual({}, graph.get_parent_map(['rev1']))
 
1254
        tree.commit('message', rev_id='rev1')
 
1255
        graph = tree.branch.repository.get_graph()
 
1256
        self.assertEqual({'rev1': ('null:',)}, graph.get_parent_map(['rev1']))
 
1257
 
 
1258
 
1239
1259
class TestRepositoryGetRevisionGraph(TestRemoteRepository):
1240
1260
    
1241
1261
    def test_null_revision(self):