~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-25 03:00:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5695.
  • Revision ID: andrew.bennetts@canonical.com-20110225030035-12360oih60fxxa1t
Rename a variable, update a docstring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
350
350
 
351
351
    Factors that go into determining the sort of fetch to perform:
352
352
     * did the caller specify any revision IDs?
353
 
     * did the caller specify a source branch (need to fetch the tip + tags)
 
353
     * did the caller specify a source branch (need to fetch its
 
354
       heads_to_fetch(), usually the tip + tags)
354
355
     * is there an existing target repo (don't need to refetch revs it
355
356
       already has)
356
357
     * target is stacked?  (similar to pre-existing target repo: even if
392
393
                    self.target_repo, self.source_repo).execute()
393
394
        heads_to_fetch = set(self._explicit_rev_ids)
394
395
        if self.source_branch is not None:
395
 
            must_fetch, tags_to_fetch = self.source_branch.heads_to_fetch()
 
396
            must_fetch, if_present_fetch = self.source_branch.heads_to_fetch()
396
397
            if self.source_branch_stop_revision_id is not None:
397
398
                # Replace the tip rev from must_fetch with the stop revision
398
399
                # XXX: this might be wrong if the tip rev is also in the
403
404
                must_fetch.add(self.source_branch_stop_revision_id)
404
405
            heads_to_fetch.update(must_fetch)
405
406
        else:
406
 
            tags_to_fetch = set()
 
407
            if_present_fetch = set()
407
408
        if self.target_repo_kind == TargetRepoKinds.EMPTY:
408
409
            # PendingAncestryResult does not raise errors if a requested head
409
410
            # is absent.  Ideally it would support the
410
411
            # required_ids/if_present_ids distinction, but in practice
411
412
            # heads_to_fetch will almost certainly be present so this doesn't
412
413
            # matter much.
413
 
            all_heads = heads_to_fetch.union(tags_to_fetch)
 
414
            all_heads = heads_to_fetch.union(if_present_fetch)
414
415
            return graph.PendingAncestryResult(all_heads, self.source_repo)
415
416
        return graph.NotInOtherForRevs(self.target_repo, self.source_repo,
416
 
            required_ids=heads_to_fetch, if_present_ids=tags_to_fetch
 
417
            required_ids=heads_to_fetch, if_present_ids=if_present_fetch
417
418
            ).execute()
418
419
 
419
420