2602
2594
_serializer=self._serializer)
2605
class RepositoryFormatKnitPack1(RepositoryFormatPack):
2606
"""A no-subtrees parameterized Pack repository.
2608
This format was introduced in 0.92.
2611
repository_class = KnitPackRepository
2612
_commit_builder_class = PackCommitBuilder
2614
def _serializer(self):
2615
return xml5.serializer_v5
2616
# What index classes to use
2617
index_builder_class = InMemoryGraphIndex
2618
index_class = GraphIndex
2620
def _get_matching_bzrdir(self):
2621
return bzrdir.format_registry.make_bzrdir('pack-0.92')
2623
def _ignore_setting_bzrdir(self, format):
2626
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2628
def get_format_string(self):
2629
"""See RepositoryFormat.get_format_string()."""
2630
return "Bazaar pack repository format 1 (needs bzr 0.92)\n"
2632
def get_format_description(self):
2633
"""See RepositoryFormat.get_format_description()."""
2634
return "Packs containing knits without subtree support"
2637
class RepositoryFormatKnitPack3(RepositoryFormatPack):
2638
"""A subtrees parameterized Pack repository.
2640
This repository format uses the xml7 serializer to get:
2641
- support for recording full info about the tree root
2642
- support for recording tree-references
2644
This format was introduced in 0.92.
2647
repository_class = KnitPackRepository
2648
_commit_builder_class = PackRootCommitBuilder
2649
rich_root_data = True
2651
supports_tree_reference = True
2653
def _serializer(self):
2654
return xml7.serializer_v7
2655
# What index classes to use
2656
index_builder_class = InMemoryGraphIndex
2657
index_class = GraphIndex
2659
def _get_matching_bzrdir(self):
2660
return bzrdir.format_registry.make_bzrdir(
2661
'pack-0.92-subtree')
2663
def _ignore_setting_bzrdir(self, format):
2666
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2668
def get_format_string(self):
2669
"""See RepositoryFormat.get_format_string()."""
2670
return "Bazaar pack repository format 1 with subtree support (needs bzr 0.92)\n"
2672
def get_format_description(self):
2673
"""See RepositoryFormat.get_format_description()."""
2674
return "Packs containing knits with subtree support\n"
2677
class RepositoryFormatKnitPack4(RepositoryFormatPack):
2678
"""A rich-root, no subtrees parameterized Pack repository.
2680
This repository format uses the xml6 serializer to get:
2681
- support for recording full info about the tree root
2683
This format was introduced in 1.0.
2686
repository_class = KnitPackRepository
2687
_commit_builder_class = PackRootCommitBuilder
2688
rich_root_data = True
2689
supports_tree_reference = False
2691
def _serializer(self):
2692
return xml6.serializer_v6
2693
# What index classes to use
2694
index_builder_class = InMemoryGraphIndex
2695
index_class = GraphIndex
2697
def _get_matching_bzrdir(self):
2698
return bzrdir.format_registry.make_bzrdir(
2701
def _ignore_setting_bzrdir(self, format):
2704
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2706
def get_format_string(self):
2707
"""See RepositoryFormat.get_format_string()."""
2708
return ("Bazaar pack repository format 1 with rich root"
2709
" (needs bzr 1.0)\n")
2711
def get_format_description(self):
2712
"""See RepositoryFormat.get_format_description()."""
2713
return "Packs containing knits with rich root support\n"
2716
class RepositoryFormatKnitPack5(RepositoryFormatPack):
2717
"""Repository that supports external references to allow stacking.
2721
Supports external lookups, which results in non-truncated ghosts after
2722
reconcile compared to pack-0.92 formats.
2725
repository_class = KnitPackRepository
2726
_commit_builder_class = PackCommitBuilder
2727
supports_external_lookups = True
2728
# What index classes to use
2729
index_builder_class = InMemoryGraphIndex
2730
index_class = GraphIndex
2733
def _serializer(self):
2734
return xml5.serializer_v5
2736
def _get_matching_bzrdir(self):
2737
return bzrdir.format_registry.make_bzrdir('1.6')
2739
def _ignore_setting_bzrdir(self, format):
2742
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2744
def get_format_string(self):
2745
"""See RepositoryFormat.get_format_string()."""
2746
return "Bazaar RepositoryFormatKnitPack5 (bzr 1.6)\n"
2748
def get_format_description(self):
2749
"""See RepositoryFormat.get_format_description()."""
2750
return "Packs 5 (adds stacking support, requires bzr 1.6)"
2753
class RepositoryFormatKnitPack5RichRoot(RepositoryFormatPack):
2754
"""A repository with rich roots and stacking.
2756
New in release 1.6.1.
2758
Supports stacking on other repositories, allowing data to be accessed
2759
without being stored locally.
2762
repository_class = KnitPackRepository
2763
_commit_builder_class = PackRootCommitBuilder
2764
rich_root_data = True
2765
supports_tree_reference = False # no subtrees
2766
supports_external_lookups = True
2767
# What index classes to use
2768
index_builder_class = InMemoryGraphIndex
2769
index_class = GraphIndex
2772
def _serializer(self):
2773
return xml6.serializer_v6
2775
def _get_matching_bzrdir(self):
2776
return bzrdir.format_registry.make_bzrdir(
2779
def _ignore_setting_bzrdir(self, format):
2782
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2784
def get_format_string(self):
2785
"""See RepositoryFormat.get_format_string()."""
2786
return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6.1)\n"
2788
def get_format_description(self):
2789
return "Packs 5 rich-root (adds stacking support, requires bzr 1.6.1)"
2792
class RepositoryFormatKnitPack5RichRootBroken(RepositoryFormatPack):
2793
"""A repository with rich roots and external references.
2797
Supports external lookups, which results in non-truncated ghosts after
2798
reconcile compared to pack-0.92 formats.
2800
This format was deprecated because the serializer it uses accidentally
2801
supported subtrees, when the format was not intended to. This meant that
2802
someone could accidentally fetch from an incorrect repository.
2805
repository_class = KnitPackRepository
2806
_commit_builder_class = PackRootCommitBuilder
2807
rich_root_data = True
2808
supports_tree_reference = False # no subtrees
2810
supports_external_lookups = True
2811
# What index classes to use
2812
index_builder_class = InMemoryGraphIndex
2813
index_class = GraphIndex
2816
def _serializer(self):
2817
return xml7.serializer_v7
2819
def _get_matching_bzrdir(self):
2820
matching = bzrdir.format_registry.make_bzrdir(
2822
matching.repository_format = self
2825
def _ignore_setting_bzrdir(self, format):
2828
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2830
def get_format_string(self):
2831
"""See RepositoryFormat.get_format_string()."""
2832
return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6)\n"
2834
def get_format_description(self):
2835
return ("Packs 5 rich-root (adds stacking support, requires bzr 1.6)"
2838
def is_deprecated(self):
2842
class RepositoryFormatKnitPack6(RepositoryFormatPack):
2843
"""A repository with stacking and btree indexes,
2844
without rich roots or subtrees.
2846
This is equivalent to pack-1.6 with B+Tree indices.
2849
repository_class = KnitPackRepository
2850
_commit_builder_class = PackCommitBuilder
2851
supports_external_lookups = True
2852
# What index classes to use
2853
index_builder_class = btree_index.BTreeBuilder
2854
index_class = btree_index.BTreeGraphIndex
2857
def _serializer(self):
2858
return xml5.serializer_v5
2860
def _get_matching_bzrdir(self):
2861
return bzrdir.format_registry.make_bzrdir('1.9')
2863
def _ignore_setting_bzrdir(self, format):
2866
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2868
def get_format_string(self):
2869
"""See RepositoryFormat.get_format_string()."""
2870
return "Bazaar RepositoryFormatKnitPack6 (bzr 1.9)\n"
2872
def get_format_description(self):
2873
"""See RepositoryFormat.get_format_description()."""
2874
return "Packs 6 (uses btree indexes, requires bzr 1.9)"
2877
class RepositoryFormatKnitPack6RichRoot(RepositoryFormatPack):
2878
"""A repository with rich roots, no subtrees, stacking and btree indexes.
2880
1.6-rich-root with B+Tree indices.
2883
repository_class = KnitPackRepository
2884
_commit_builder_class = PackRootCommitBuilder
2885
rich_root_data = True
2886
supports_tree_reference = False # no subtrees
2887
supports_external_lookups = True
2888
# What index classes to use
2889
index_builder_class = btree_index.BTreeBuilder
2890
index_class = btree_index.BTreeGraphIndex
2893
def _serializer(self):
2894
return xml6.serializer_v6
2896
def _get_matching_bzrdir(self):
2897
return bzrdir.format_registry.make_bzrdir(
2900
def _ignore_setting_bzrdir(self, format):
2903
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2905
def get_format_string(self):
2906
"""See RepositoryFormat.get_format_string()."""
2907
return "Bazaar RepositoryFormatKnitPack6RichRoot (bzr 1.9)\n"
2909
def get_format_description(self):
2910
return "Packs 6 rich-root (uses btree indexes, requires bzr 1.9)"
2913
class RepositoryFormatPackDevelopment2Subtree(RepositoryFormatPack):
2914
"""A subtrees development repository.
2916
This format should be retained in 2.3, to provide an upgrade path from this
2917
to RepositoryFormat2aSubtree. It can be removed in later releases.
2919
1.6.1-subtree[as it might have been] with B+Tree indices.
2922
repository_class = KnitPackRepository
2923
_commit_builder_class = PackRootCommitBuilder
2924
rich_root_data = True
2926
supports_tree_reference = True
2927
supports_external_lookups = True
2928
# What index classes to use
2929
index_builder_class = btree_index.BTreeBuilder
2930
index_class = btree_index.BTreeGraphIndex
2933
def _serializer(self):
2934
return xml7.serializer_v7
2936
def _get_matching_bzrdir(self):
2937
return bzrdir.format_registry.make_bzrdir(
2938
'development5-subtree')
2940
def _ignore_setting_bzrdir(self, format):
2943
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2945
def get_format_string(self):
2946
"""See RepositoryFormat.get_format_string()."""
2947
return ("Bazaar development format 2 with subtree support "
2948
"(needs bzr.dev from before 1.8)\n")
2950
def get_format_description(self):
2951
"""See RepositoryFormat.get_format_description()."""
2952
return ("Development repository format, currently the same as "
2953
"1.6.1-subtree with B+Tree indices.\n")
2956
2597
class RetryPackOperations(errors.RetryWithNewPacks):
2957
2598
"""Raised when we are packing and we find a missing file.