~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/vf_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-08 11:34:17 UTC
  • mto: This revision was merged to the branch mainline in revision 5844.
  • Revision ID: jelmer@samba.org-20110508113417-yncmzfuj8f5cklxj
Fix test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2453
2453
 
2454
2454
    @staticmethod
2455
2455
    def is_compatible(source, target):
 
2456
        if not source._format.supports_full_versioned_files:
 
2457
            return False
 
2458
        if not target._format.supports_full_versioned_files:
 
2459
            return False
2456
2460
        # This is redundant with format.check_conversion_target(), however that
2457
2461
        # raises an exception, and we just want to say "False" as in we won't
2458
2462
        # support converting between these formats.
2475
2479
            return False
2476
2480
        if not target.bzrdir.transport.base.startswith('file:///'):
2477
2481
            return False
2478
 
        if not source._format.supports_full_versioned_files:
2479
 
            return False
2480
 
        if not target._format.supports_full_versioned_files:
2481
 
            return False
2482
2482
        return True
2483
2483
 
2484
2484
    def _get_trees(self, revision_ids, cache):
2787
2787
        return basis_id, basis_tree
2788
2788
 
2789
2789
 
 
2790
class InterSameDataRepository(InterRepository):
 
2791
    """Code for converting between repositories that represent the same data.
 
2792
 
 
2793
    Data format and model must match for this to work.
 
2794
    """
 
2795
 
 
2796
    @classmethod
 
2797
    def _get_repo_format_to_test(self):
 
2798
        """Repository format for testing with.
 
2799
 
 
2800
        InterSameData can pull from subtree to subtree and from non-subtree to
 
2801
        non-subtree, so we test this with the richest repository format.
 
2802
        """
 
2803
        from bzrlib.repofmt import knitrepo
 
2804
        return knitrepo.RepositoryFormatKnit3()
 
2805
 
 
2806
    @staticmethod
 
2807
    def is_compatible(source, target):
 
2808
        return (
 
2809
            InterRepository._same_model(source, target) and
 
2810
            source._format.supports_full_versioned_files and
 
2811
            target._format.supports_full_versioned_files)
 
2812
 
 
2813
 
2790
2814
InterRepository.register_optimiser(InterDifferingSerializer)
 
2815
InterRepository.register_optimiser(InterSameDataRepository)
2791
2816
 
2792
2817
 
2793
2818
def install_revisions(repository, iterable, num_revisions=None, pb=None):