~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    lru_cache,
41
41
    osutils,
42
42
    revision as _mod_revision,
 
43
    static_tuple,
43
44
    symbol_versioning,
44
45
    trace,
45
46
    tsort,
2626
2627
    def _make_parents_provider(self):
2627
2628
        return self
2628
2629
 
 
2630
    @needs_read_lock
 
2631
    def get_known_graph_ancestry(self, revision_ids):
 
2632
        """Return the known graph for a set of revision ids and their ancestors.
 
2633
        """
 
2634
        st = static_tuple.StaticTuple
 
2635
        revision_keys = [st(r_id).intern() for r_id in revision_ids]
 
2636
        known_graph = self.revisions.get_known_graph_ancestry(revision_keys)
 
2637
        return graph.GraphThunkIdsToKeys(known_graph)
 
2638
 
2629
2639
    def get_graph(self, other_repository=None):
2630
2640
        """Return the graph walker for this repository format"""
2631
2641
        parents_provider = self._make_parents_provider()
3033
3043
    # Is the format experimental ?
3034
3044
    experimental = False
3035
3045
 
3036
 
    def __str__(self):
3037
 
        return "<%s>" % self.__class__.__name__
 
3046
    def __repr__(self):
 
3047
        return "%s()" % self.__class__.__name__
3038
3048
 
3039
3049
    def __eq__(self, other):
3040
3050
        # format objects are generally stateless
3372
3382
        :return: None.
3373
3383
        """
3374
3384
        ui.ui_factory.warn_experimental_format_fetch(self)
3375
 
        f = _mod_fetch.RepoFetcher(to_repository=self.target,
 
3385
        from bzrlib.fetch import RepoFetcher
 
3386
        # See <https://launchpad.net/bugs/456077> asking for a warning here
 
3387
        if self.source._format.network_name() != self.target._format.network_name():
 
3388
            ui.ui_factory.show_user_warning('cross_format_fetch',
 
3389
                from_format=self.source._format,
 
3390
                to_format=self.target._format)
 
3391
        f = RepoFetcher(to_repository=self.target,
3376
3392
                               from_repository=self.source,
3377
3393
                               last_revision=revision_id,
3378
3394
                               fetch_spec=fetch_spec,
3956
3972
        """See InterRepository.fetch()."""
3957
3973
        if fetch_spec is not None:
3958
3974
            raise AssertionError("Not implemented yet...")
3959
 
        # See <https://launchpad.net/bugs/456077> asking for a warning here
3960
 
        #
3961
 
        # nb this is only active for local-local fetches; other things using
3962
 
        # streaming.
3963
 
        ui.ui_factory.warn_cross_format_fetch(self.source._format,
3964
 
            self.target._format)
3965
3975
        ui.ui_factory.warn_experimental_format_fetch(self)
3966
3976
        if (not self.source.supports_rich_root()
3967
3977
            and self.target.supports_rich_root()):
3969
3979
            self._revision_id_to_root_id = {}
3970
3980
        else:
3971
3981
            self._converting_to_rich_root = False
 
3982
        # See <https://launchpad.net/bugs/456077> asking for a warning here
 
3983
        if self.source._format.network_name() != self.target._format.network_name():
 
3984
            ui.ui_factory.show_user_warning('cross_format_fetch',
 
3985
                from_format=self.source._format,
 
3986
                to_format=self.target._format)
3972
3987
        revision_ids = self.target.search_missing_revision_ids(self.source,
3973
3988
            revision_id, find_ghosts=find_ghosts).get_keys()
3974
3989
        if not revision_ids:
4257
4272
                    self._extract_and_insert_inventories(
4258
4273
                        substream, src_serializer)
4259
4274
            elif substream_type == 'inventory-deltas':
4260
 
                ui.ui_factory.warn_cross_format_fetch(src_format,
4261
 
                    self.target_repo._format)
4262
4275
                self._extract_and_insert_inventory_deltas(
4263
4276
                    substream, src_serializer)
4264
4277
            elif substream_type == 'chk_bytes':