~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Aaron Bentley
  • Date: 2007-11-25 17:54:55 UTC
  • mto: This revision was merged to the branch mainline in revision 3026.
  • Revision ID: aaron.bentley@utoronto.ca-20071125175455-3zoctrg96t1hmt1s
Implement rich-root-pack format ( #164639)

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 xml7 serializer to get:
 
1880
     - support for recording full info about the tree root
 
1881
     - support for recording tree-references
 
1882
 
 
1883
    This format was introduced in 0.92.
 
1884
    """
 
1885
 
 
1886
    repository_class = KnitPackRepository
 
1887
    _commit_builder_class = PackRootCommitBuilder
 
1888
    rich_root_data = True
 
1889
    supports_tree_reference = False
 
1890
    _serializer = xml6.serializer_v6
 
1891
 
 
1892
    def _get_matching_bzrdir(self):
 
1893
        return bzrdir.format_registry.make_bzrdir(
 
1894
            'rich-root-pack')
 
1895
 
 
1896
    def _ignore_setting_bzrdir(self, format):
 
1897
        pass
 
1898
 
 
1899
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
1900
 
 
1901
    def check_conversion_target(self, target_format):
 
1902
        if not target_format.rich_root_data:
 
1903
            raise errors.BadConversionTarget(
 
1904
                'Does not support rich root data.', target_format)
 
1905
 
 
1906
    def get_format_string(self):
 
1907
        """See RepositoryFormat.get_format_string()."""
 
1908
        return ("Bazaar pack repository format 1 with rich root"
 
1909
                " (needs bzr 1.0)\n")
 
1910
 
 
1911
    def get_format_description(self):
 
1912
        """See RepositoryFormat.get_format_description()."""
 
1913
        return "Packs containing knits with rich root support\n"