~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

(spiv) Fetch tagged revisions (not just tags) during branch,
 merge and pull. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1608
1608
        if symbol_versioning.deprecated_passed(revision_id):
1609
1609
            symbol_versioning.warn(
1610
1610
                'search_missing_revision_ids(revision_id=...) was '
1611
 
                'deprecated in 2.3.  Use revision_ids=[...] instead.',
 
1611
                'deprecated in 2.4.  Use revision_ids=[...] instead.',
1612
1612
                DeprecationWarning, stacklevel=3)
1613
1613
            if revision_ids is not None:
1614
1614
                raise AssertionError(
1785
1785
                not _mod_revision.is_null(revision_id)):
1786
1786
                self.get_revision(revision_id)
1787
1787
            return 0, []
1788
 
        # if there is no specific appropriate InterRepository, this will get
1789
 
        # the InterRepository base class, which raises an
1790
 
        # IncompatibleRepositories when asked to fetch.
1791
1788
        inter = InterRepository.get(source, self)
1792
1789
        return inter.fetch(revision_id=revision_id, pb=pb,
1793
1790
            find_ghosts=find_ghosts, fetch_spec=fetch_spec)
3526
3523
        if symbol_versioning.deprecated_passed(revision_id):
3527
3524
            symbol_versioning.warn(
3528
3525
                'search_missing_revision_ids(revision_id=...) was '
3529
 
                'deprecated in 2.3.  Use revision_ids=[...] instead.',
 
3526
                'deprecated in 2.4.  Use revision_ids=[...] instead.',
3530
3527
                DeprecationWarning, stacklevel=2)
3531
3528
            if revision_ids is not None:
3532
3529
                raise AssertionError(
3901
3898
            fetch_spec=None):
3902
3899
        """See InterRepository.fetch()."""
3903
3900
        if fetch_spec is not None:
3904
 
            if (isinstance(fetch_spec, graph.NotInOtherForRevs) and
3905
 
                    len(fetch_spec.required_ids) == 1 and not
3906
 
                    fetch_spec.if_present_ids):
3907
 
                revision_id = list(fetch_spec.required_ids)[0]
3908
 
                del fetch_spec
3909
 
            else:
3910
 
                raise AssertionError("Not implemented yet...")
 
3901
            revision_ids = fetch_spec.get_keys()
 
3902
        else:
 
3903
            revision_ids = None
3911
3904
        ui.ui_factory.warn_experimental_format_fetch(self)
3912
3905
        if (not self.source.supports_rich_root()
3913
3906
            and self.target.supports_rich_root()):
3920
3913
            ui.ui_factory.show_user_warning('cross_format_fetch',
3921
3914
                from_format=self.source._format,
3922
3915
                to_format=self.target._format)
3923
 
        if revision_id:
3924
 
            search_revision_ids = [revision_id]
3925
 
        else:
3926
 
            search_revision_ids = None
3927
 
        revision_ids = self.target.search_missing_revision_ids(self.source,
3928
 
            revision_ids=search_revision_ids, find_ghosts=find_ghosts).get_keys()
 
3916
        if revision_ids is None:
 
3917
            if revision_id:
 
3918
                search_revision_ids = [revision_id]
 
3919
            else:
 
3920
                search_revision_ids = None
 
3921
            revision_ids = self.target.search_missing_revision_ids(self.source,
 
3922
                revision_ids=search_revision_ids,
 
3923
                find_ghosts=find_ghosts).get_keys()
3929
3924
        if not revision_ids:
3930
3925
            return 0, 0
3931
3926
        revision_ids = tsort.topo_sort(