~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-26 15:13:29 UTC
  • mfrom: (2996.2.13 rich-root)
  • Revision ID: pqm@pqm.ubuntu.com-20071126151329-pnmm49obwettpwcd
Introduce rich-root-pack format

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    osutils,
49
49
    transactions,
50
50
    xml5,
 
51
    xml6,
51
52
    xml7,
52
53
    )
53
54
 
1870
1871
    def get_format_description(self):
1871
1872
        """See RepositoryFormat.get_format_description()."""
1872
1873
        return "Packs containing knits with subtree support\n"
 
1874
 
 
1875
 
 
1876
class RepositoryFormatKnitPack4(RepositoryFormatPack):
 
1877
    """A rich-root, no subtrees parameterised Pack repository.
 
1878
 
 
1879
    This repository format uses the xml6 serializer to get:
 
1880
     - support for recording full info about the tree root
 
1881
 
 
1882
    This format was introduced in 1.0.
 
1883
    """
 
1884
 
 
1885
    repository_class = KnitPackRepository
 
1886
    _commit_builder_class = PackRootCommitBuilder
 
1887
    rich_root_data = True
 
1888
    supports_tree_reference = False
 
1889
    _serializer = xml6.serializer_v6
 
1890
 
 
1891
    def _get_matching_bzrdir(self):
 
1892
        return bzrdir.format_registry.make_bzrdir(
 
1893
            'rich-root-pack')
 
1894
 
 
1895
    def _ignore_setting_bzrdir(self, format):
 
1896
        pass
 
1897
 
 
1898
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
1899
 
 
1900
    def check_conversion_target(self, target_format):
 
1901
        if not target_format.rich_root_data:
 
1902
            raise errors.BadConversionTarget(
 
1903
                'Does not support rich root data.', target_format)
 
1904
 
 
1905
    def get_format_string(self):
 
1906
        """See RepositoryFormat.get_format_string()."""
 
1907
        return ("Bazaar pack repository format 1 with rich root"
 
1908
                " (needs bzr 1.0)\n")
 
1909
 
 
1910
    def get_format_description(self):
 
1911
        """See RepositoryFormat.get_format_description()."""
 
1912
        return "Packs containing knits with rich root support\n"