~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/interrepository_implementations/test_fetch.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-07 07:49:28 UTC
  • mto: (4476.3.44 inventory-delta)
  • mto: This revision was merged to the branch mainline in revision 4608.
  • Revision ID: andrew.bennetts@canonical.com-20090707074928-miuk8x4gzvr6ihly
All fetch and interrepo tests passing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from bzrlib.errors import (
29
29
    NoSuchRevision,
30
30
    )
 
31
from bzrlib.graph import (
 
32
    SearchResult,
 
33
    )
31
34
from bzrlib.revision import (
32
35
    NULL_REVISION,
33
36
    Revision,
158
161
        self.addCleanup(unstacked_repo.unlock)
159
162
        self.assertFalse(unstacked_repo.has_revision('left'))
160
163
        self.assertFalse(unstacked_repo.has_revision('right'))
161
 
        self.assertEqual(
162
 
            set([('left',), ('right',), ('merge',)]),
163
 
            unstacked_repo.inventories.keys())
 
164
        self.assertTrue(unstacked_repo.has_revision('merge'))
 
165
        # We used to check for the presence of parent invs here, but what
 
166
        # really matters is that the repo can stream the new revision without
 
167
        # the help of any fallback repos.
 
168
        self.assertCanStreamRevision(unstacked_repo, 'merge')
 
169
#        self.assertEqual(
 
170
#            set([('left',), ('right',), ('merge',)]),
 
171
#            unstacked_repo.inventories.keys())
 
172
 
 
173
    def assertCanStreamRevision(self, repo, revision_id):
 
174
        exclude_keys = set(repo.all_revision_ids()) - set([revision_id])
 
175
        search = SearchResult([revision_id], exclude_keys, 1, [revision_id])
 
176
        source = repo._get_source(repo._format)
 
177
        for substream_kind, substream in source.get_stream(search):
 
178
            # Consume the substream
 
179
            list(substream)
164
180
 
165
181
    def test_fetch_missing_basis_text(self):
166
182
        """If fetching a delta, we should die if a basis is not present."""