~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-21 07:27:20 UTC
  • mto: This revision was merged to the branch mainline in revision 5695.
  • Revision ID: andrew.bennetts@canonical.com-20110221072720-z0hszotbfz5rs9s2
Refactor some of FetchSpecFactory into new Branch.heads_to_fetch method so that branch implementations like looms can override it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
391
391
                return graph.EverythingNotInOther(
392
392
                    self.target_repo, self.source_repo).execute()
393
393
        heads_to_fetch = set(self._explicit_rev_ids)
394
 
        tags_to_fetch = set()
395
394
        if self.source_branch is not None:
396
 
            try:
397
 
                tags_to_fetch.update(
398
 
                    self.source_branch.tags.get_reverse_tag_dict())
399
 
            except errors.TagsNotSupported:
400
 
                pass
 
395
            must_fetch, tags_to_fetch = self.source_branch.heads_to_fetch()
401
396
            if self.source_branch_stop_revision_id is not None:
402
 
                heads_to_fetch.add(self.source_branch_stop_revision_id)
403
 
            else:
404
 
                heads_to_fetch.add(self.source_branch.last_revision())
 
397
                # Replace the tip rev from must_fetch with the stop revision
 
398
                # XXX: this might be wrong if the tip rev is also in the
 
399
                # must_fetch set for other reasons (e.g. it's the tip of
 
400
                # multiple loom threads?), but then it's pretty unclear what it
 
401
                # should mean to specify a stop_revision in that case anyway.
 
402
                must_fetch.discard(self.source_branch.last_revision())
 
403
                must_fetch.add(self.source_branch_stop_revision_id)
 
404
            heads_to_fetch.update(must_fetch)
 
405
        else:
 
406
            tags_to_fetch = set()
405
407
        if self.target_repo_kind == TargetRepoKinds.EMPTY:
406
408
            # PendingAncestryResult does not raise errors if a requested head
407
409
            # is absent.  Ideally it would support the