46
47
KnitPackRepository,
47
48
RepositoryPackCollection,
48
RepositoryFormatPackDevelopment2,
49
RepositoryFormatPackDevelopment2Subtree,
50
RepositoryFormatKnitPack1,
51
RepositoryFormatKnitPack3,
52
RepositoryFormatKnitPack4,
49
RepositoryFormatKnitPack6,
50
RepositoryFormatKnitPack6RichRoot,
166
163
self.write_stream = self.upload_transport.open_write_stream(
167
164
self.random_name, mode=self._file_mode)
168
165
if 'pack' in debug.debug_flags:
169
mutter('%s: create_pack: pack stream open: %s%s t+%6.3fs',
166
trace.mutter('%s: create_pack: pack stream open: %s%s t+%6.3fs',
170
167
time.ctime(), self.upload_transport.base, self.random_name,
171
168
time.time() - self.start_time)
172
169
# A list of byte sequences to be written to the new pack, and the
320
317
for stream in _get_referenced_stream(p_id_roots):
322
319
if remaining_keys:
323
note('There were %d keys in the chk index, which were not'
324
' referenced from inventories', len(remaining_keys))
320
trace.note('There were %d keys in the chk index, which were not'
321
' referenced from inventories', len(remaining_keys))
325
322
stream = source_vf.get_record_stream(remaining_keys, 'unordered',
376
373
for pack in packs:
377
374
source_index = getattr(pack, index_name)
378
375
keys.update(e[1] for e in source_index.iter_all_entries())
376
trace.mutter('repacking %s with %d keys',
379
378
source_vf = getattr(self.repo, vf_name)
380
379
target_access = knit._DirectPackAccess({})
381
380
target_access.set_writer(new_pack._writer, new_index,
590
589
self._fetch_uses_deltas = False
593
class RepositoryFormatPackGCPlain(RepositoryFormatPackDevelopment2):
592
class RepositoryFormatPackGCPlain(RepositoryFormatKnitPack6):
594
593
"""A B+Tree index using pack repository."""
596
595
repository_class = GCPackRepository
596
rich_root_data = False
598
598
def get_format_string(self):
599
599
"""See RepositoryFormat.get_format_string()."""
600
600
return ("Bazaar development format - btree+gc "
601
"(needs bzr.dev from 1.6)\n")
601
"(needs bzr.dev from 1.13)\n")
603
603
def get_format_description(self):
604
604
"""See RepositoryFormat.get_format_description()."""
606
606
", interoperates with pack-0.92\n")
609
class RepositoryFormatPackGCRichRoot(RepositoryFormatKnitPack4):
610
"""A B+Tree index using pack repository."""
612
repository_class = GCPackRepository
614
def get_format_string(self):
615
"""See RepositoryFormat.get_format_string()."""
616
return ("Bazaar development format - btree+gc-rich-root "
617
"(needs bzr.dev from 1.6)\n")
619
def get_format_description(self):
620
"""See RepositoryFormat.get_format_description()."""
621
return ("Development repository format - btree+groupcompress "
622
", interoperates with rich-root-pack\n")
625
class RepositoryFormatPackGCSubtrees(RepositoryFormatPackDevelopment2Subtree):
626
"""A B+Tree index using pack repository."""
628
repository_class = GCPackRepository
630
def get_format_string(self):
631
"""See RepositoryFormat.get_format_string()."""
632
return ("Bazaar development format - btree+gc-subtrees "
633
"(needs bzr.dev from 1.6)\n")
635
def get_format_description(self):
636
"""See RepositoryFormat.get_format_description()."""
637
return ("Development repository format - btree+groupcompress "
638
", interoperates with pack-0.92-subtrees\n")
641
class RepositoryFormatPackGCPlainCHK(RepositoryFormatPackDevelopment5):
642
"""A CHK+group compress pack repository."""
644
repository_class = GCCHKPackRepository
646
def get_format_string(self):
647
"""See RepositoryFormat.get_format_string()."""
648
return ('Bazaar development format - chk+gc'
649
' (needs bzr.dev from 1.13)\n')
651
def get_format_description(self):
652
"""See RepositoryFormat.get_format_description()."""
653
return ("Development repository format - chk+groupcompress")
656
class RepositoryFormatPackGCPlainCHK16(RepositoryFormatPackDevelopment5Hash16):
610
class RepositoryFormatPackGCCHK16(RepositoryFormatPackDevelopment5Hash16):
657
611
"""A hashed CHK+group compress pack repository."""
659
613
repository_class = GCCHKPackRepository
614
rich_root_data = True
661
616
def get_format_string(self):
662
617
"""See RepositoryFormat.get_format_string()."""
663
return ('Bazaar development format - hash16chk+gc'
618
return ('Bazaar development format - hash16chk+gc rich-root'
664
619
' (needs bzr.dev from 1.13)\n')
666
621
def get_format_description(self):
668
623
return ("Development repository format - hash16chk+groupcompress")
671
## class RepositoryFormatPackGCPlainCHK16b(RepositoryFormatPackDevelopment5Hash16b):
672
## """A hashed CHK+group compress pack repository."""
674
## repository_class = GCCHKPackRepository
676
## def get_format_string(self):
677
## """See RepositoryFormat.get_format_string()."""
678
## return ('Bazaar development format - hash16bchk+gc'
679
## ' (needs bzr.dev from 1.13)\n')
681
## def get_format_description(self):
682
## """See RepositoryFormat.get_format_description()."""
683
## return ("Development repository format - hash16bchk+groupcompress")
686
## class RepositoryFormatPackGCPlainCHK63(RepositoryFormatPackDevelopment5Hash63):
687
## """A hashed CHK+group compress pack repository."""
689
## repository_class = GCCHKPackRepository
691
## def get_format_string(self):
692
## """See RepositoryFormat.get_format_string()."""
693
## return ('Bazaar development format - hash63+gc'
694
## ' (needs bzr.dev from 1.13)\n')
696
## def get_format_description(self):
697
## """See RepositoryFormat.get_format_description()."""
698
## return ("Development repository format - hash63+groupcompress")
701
## class RepositoryFormatPackGCPlainCHK127a(RepositoryFormatPackDevelopment5Hash127a):
702
## """A hashed CHK+group compress pack repository."""
704
## repository_class = GCCHKPackRepository
706
## def get_format_string(self):
707
## """See RepositoryFormat.get_format_string()."""
708
## return ('Bazaar development format - hash127a+gc'
709
## ' (needs bzr.dev from 1.13)\n')
711
## def get_format_description(self):
712
## """See RepositoryFormat.get_format_description()."""
713
## return ("Development repository format - hash127a+groupcompress")
716
## class RepositoryFormatPackGCPlainCHK127b(RepositoryFormatPackDevelopment5Hash127b):
717
## """A hashed CHK+group compress pack repository."""
719
## repository_class = GCCHKPackRepository
721
## def get_format_string(self):
722
## """See RepositoryFormat.get_format_string()."""
723
## return ('Bazaar development format - hash127b+gc'
724
## ' (needs bzr.dev from 1.13)\n')
726
## def get_format_description(self):
727
## """See RepositoryFormat.get_format_description()."""
728
## return ("Development repository format - hash127b+groupcompress")
731
class RepositoryFormatPackGCPlainCHK255(RepositoryFormatPackDevelopment5Hash255):
626
class RepositoryFormatPackGCCHK255(RepositoryFormatPackDevelopment5Hash255):
732
627
"""A hashed CHK+group compress pack repository."""
734
629
repository_class = GCCHKPackRepository
630
rich_root_data = True
736
632
def get_format_string(self):
737
633
"""See RepositoryFormat.get_format_string()."""
738
return ('Bazaar development format - hash255chk+gc'
634
return ('Bazaar development format - hash255chk+gc rich-root'
739
635
' (needs bzr.dev from 1.13)\n')
741
637
def get_format_description(self):
746
642
def pack_incompatible(source, target, orig_method=InterPackRepo.is_compatible):
747
643
"""Be incompatible with the regular fetch code."""
748
formats = (RepositoryFormatPackGCPlain, RepositoryFormatPackGCRichRoot,
749
RepositoryFormatPackGCSubtrees)
644
formats = (RepositoryFormatPackGC,)
751
formats = formats + (RepositoryFormatPackGCPlainCHK,
752
RepositoryFormatPackGCPlainCHK16,
753
## RepositoryFormatPackGCPlainCHK16b,
754
## RepositoryFormatPackGCPlainCHK63,
755
## RepositoryFormatPackGCPlainCHK127a,
756
## RepositoryFormatPackGCPlainCHK127b,
757
RepositoryFormatPackGCPlainCHK255)
646
formats = formats + (RepositoryFormatPackGCCHK16,
647
RepositoryFormatPackGCCHK255)
758
648
if isinstance(source._format, formats) or isinstance(target._format, formats):