~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-19 18:33:40 UTC
  • mfrom: (5972.3.25 get-ancestry-is-evil)
  • Revision ID: pqm@pqm.ubuntu.com-20110619183340-ds1rpql77nxrmo4n
(jelmer) Deprecate Repository.get_ancestry(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    config,
33
33
    controldir,
34
34
    errors,
35
 
    graph,
 
35
    graph as _mod_graph,
36
36
    inventory,
37
37
    inventory_delta,
38
38
    remote,
3244
3244
        _, stacked = branch_factory()
3245
3245
        source = stacked.repository._get_source(target_repository_format)
3246
3246
        tip = stacked.last_revision()
3247
 
        revs = stacked.repository.get_ancestry(tip)
3248
 
        search = graph.PendingAncestryResult([tip], stacked.repository)
 
3247
        stacked.repository._ensure_real()
 
3248
        graph = stacked.repository.get_graph()
 
3249
        revs = [r for (r,ps) in graph.iter_ancestry([tip])
 
3250
                if r != NULL_REVISION]
 
3251
        revs.reverse()
 
3252
        search = _mod_graph.PendingAncestryResult([tip], stacked.repository)
3249
3253
        self.reset_smart_call_log()
3250
3254
        stream = source.get_stream(search)
3251
 
        if None in revs:
3252
 
            revs.remove(None)
3253
3255
        # We trust that if a revision is in the stream the rest of the new
3254
3256
        # content for it is too, as per our main fetch tests; here we are
3255
3257
        # checking that the revisions are actually included at all, and their
3294
3296
        self.assertEqual(expected_revs, rev_ord)
3295
3297
        # Getting topological sort requires VFS calls still - one of which is
3296
3298
        # pushing up from the bound branch.
3297
 
        self.assertLength(13, self.hpss_calls)
 
3299
        self.assertLength(14, self.hpss_calls)
3298
3300
 
3299
3301
    def test_stacked_get_stream_groupcompress(self):
3300
3302
        # Repository._get_source.get_stream() from a stacked repository with
3358
3360
        remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()
3359
3361
        self.hpss_calls = []
3360
3362
        local.repository.fetch(remote_branch.repository,
3361
 
                fetch_spec=graph.EverythingResult(remote_branch.repository))
 
3363
                fetch_spec=_mod_graph.EverythingResult(remote_branch.repository))
3362
3364
        self.assertEqual(['Repository.get_stream_1.19'], self.hpss_calls)
3363
3365
 
3364
3366
    def override_verb(self, verb_name, verb):
3394
3396
        remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()
3395
3397
        self.hpss_calls = []
3396
3398
        local.repository.fetch(remote_branch.repository,
3397
 
                fetch_spec=graph.EverythingResult(remote_branch.repository))
 
3399
                fetch_spec=_mod_graph.EverythingResult(remote_branch.repository))
3398
3400
        # make sure the overridden verb was used
3399
3401
        self.assertLength(1, verb_log)
3400
3402
        # more than one HPSS call is needed, but because it's a VFS callback