~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

Merge in real stacked repository work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
495
495
        attempted.
496
496
        """
497
497
 
 
498
    def add_fallback_repository(self, repository):
 
499
        """Add a repository to use for looking up data not held locally.
 
500
        
 
501
        :param repository: A repository.
 
502
        """
 
503
        if not self._format.supports_external_lookups:
 
504
            raise errors.UnstackableRepositoryFormat(self._format, self.base)
 
505
        if not self._add_fallback_repository_check(repository):
 
506
            raise errors.IncompatibleRepositories(self, repository)
 
507
        self._fallback_repositories.append(repository)
 
508
 
 
509
    def _add_fallback_repository_check(self, repository):
 
510
        """Check that this repository can fallback to repository safely.
 
511
        
 
512
        :param repository: A repository to fallback to.
 
513
        :return: True if the repositories can stack ok.
 
514
        """
 
515
        return InterRepository._same_model(self, repository)
 
516
 
498
517
    def add_inventory(self, revision_id, inv, parents):
499
518
        """Add the inventory inv to the repository as revision_id.
500
519
        
563
582
    def all_revision_ids(self):
564
583
        """Returns a list of all the revision ids in the repository. 
565
584
 
566
 
        This is deprecated because code should generally work on the graph
567
 
        reachable from a particular revision, and ignore any other revisions
568
 
        that might be present.  There is no direct replacement method.
 
585
        This is conceptually deprecated because code should generally work on
 
586
        the graph reachable from a particular revision, and ignore any other
 
587
        revisions that might be present.  There is no direct replacement
 
588
        method.
569
589
        """
570
590
        if 'evil' in debug.debug_flags:
571
591
            mutter_callsite(2, "all_revision_ids is linear with history.")
635
655
        self._warn_if_deprecated()
636
656
        self._write_group = None
637
657
        self.base = control_files._transport.base
 
658
        # Additional places to query for data.
 
659
        self._fallback_repositories = []
638
660
 
639
661
    def __repr__(self):
640
662
        return '%s(%r)' % (self.__class__.__name__,
2332
2354
    'bzrlib.repofmt.pack_repo',
2333
2355
    'RepositoryFormatPackDevelopment0Subtree',
2334
2356
    )
 
2357
format_registry.register_lazy(
 
2358
    "Bazaar development format 1 (needs bzr.dev from before 1.3)\n",
 
2359
    'bzrlib.repofmt.pack_repo',
 
2360
    'RepositoryFormatPackDevelopment1',
 
2361
    )
 
2362
format_registry.register_lazy(
 
2363
    ("Bazaar development format 1 with subtree support "
 
2364
        "(needs bzr.dev from before 1.3)\n"),
 
2365
    'bzrlib.repofmt.pack_repo',
 
2366
    'RepositoryFormatPackDevelopment1Subtree',
 
2367
    )
2335
2368
# 1.3->1.4 go below here
2336
2369
 
2337
2370