/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-12 20:13:07 UTC
  • mfrom: (3267 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080312201307-ngd5bynt2nvhnlb7
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2090
2090
    # Set to True or False in derived classes. True indicates that the format
2091
2091
    # supports ghosts gracefully.
2092
2092
    supports_ghosts = None
 
2093
    # Can this repository be given external locations to lookup additional
 
2094
    # data. Set to True or False in derived classes.
 
2095
    supports_external_lookups = None
2093
2096
 
2094
2097
    def __str__(self):
2095
2098
        return "<%s>" % self.__class__.__name__
2116
2119
        except errors.NoSuchFile:
2117
2120
            raise errors.NoRepositoryPresent(a_bzrdir)
2118
2121
        except KeyError:
2119
 
            raise errors.UnknownFormatError(format=format_string)
 
2122
            raise errors.UnknownFormatError(format=format_string,
 
2123
                                            kind='repository')
2120
2124
 
2121
2125
    @classmethod
2122
2126
    def register_format(klass, format):
2234
2238
 
2235
2239
    rich_root_data = False
2236
2240
    supports_tree_reference = False
 
2241
    supports_external_lookups = False
2237
2242
    _matchingbzrdir = bzrdir.BzrDirMetaFormat1()
2238
2243
 
2239
2244
    def __init__(self):
2298
2303
 
2299
2304
# Pack-based formats. There is one format for pre-subtrees, and one for
2300
2305
# post-subtrees to allow ease of testing.
2301
 
# NOTE: These are experimental in 0.92.
 
2306
# NOTE: These are experimental in 0.92. Stable in 1.0 and above
2302
2307
format_registry.register_lazy(
2303
2308
    'Bazaar pack repository format 1 (needs bzr 0.92)\n',
2304
2309
    'bzrlib.repofmt.pack_repo',
2314
2319
    'bzrlib.repofmt.pack_repo',
2315
2320
    'RepositoryFormatKnitPack4',
2316
2321
    )
 
2322
# Development formats. 
 
2323
# 1.2->1.3
 
2324
# development 0 - stub to introduce development versioning scheme.
 
2325
format_registry.register_lazy(
 
2326
    "Bazaar development format 0 (needs bzr.dev from before 1.3)\n",
 
2327
    'bzrlib.repofmt.pack_repo',
 
2328
    'RepositoryFormatPackDevelopment0',
 
2329
    )
 
2330
format_registry.register_lazy(
 
2331
    ("Bazaar development format 0 with subtree support "
 
2332
        "(needs bzr.dev from before 1.3)\n"),
 
2333
    'bzrlib.repofmt.pack_repo',
 
2334
    'RepositoryFormatPackDevelopment0Subtree',
 
2335
    )
 
2336
# 1.3->1.4 go below here
2317
2337
 
2318
2338
 
2319
2339
class InterRepository(InterObject):
2826
2846
        try:
2827
2847
            from bzrlib.repofmt.knitrepo import (RepositoryFormatKnit1,
2828
2848
                RepositoryFormatKnit3)
2829
 
            from bzrlib.repofmt.pack_repo import (RepositoryFormatKnitPack1,
2830
 
                RepositoryFormatKnitPack3)
2831
 
            return (isinstance(source._format,
2832
 
                    (RepositoryFormatKnit1, RepositoryFormatKnitPack1)) and
2833
 
                isinstance(target._format,
2834
 
                    (RepositoryFormatKnit3, RepositoryFormatKnitPack3))
2835
 
                )
 
2849
            from bzrlib.repofmt.pack_repo import (
 
2850
                RepositoryFormatKnitPack1,
 
2851
                RepositoryFormatKnitPack3,
 
2852
                RepositoryFormatPackDevelopment0,
 
2853
                RepositoryFormatPackDevelopment0Subtree,
 
2854
                )
 
2855
            nosubtrees = (
 
2856
                RepositoryFormatKnit1,
 
2857
                RepositoryFormatKnitPack1,
 
2858
                RepositoryFormatPackDevelopment0,
 
2859
                )
 
2860
            subtrees = (
 
2861
                RepositoryFormatKnit3,
 
2862
                RepositoryFormatKnitPack3,
 
2863
                RepositoryFormatPackDevelopment0Subtree,
 
2864
                )
 
2865
            return (isinstance(source._format, nosubtrees) and
 
2866
                isinstance(target._format, subtrees))
2836
2867
        except AttributeError:
2837
2868
            return False
2838
2869