/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/repofmt/knitrepo.py

  • Committer: Michael Hudson
  • Date: 2007-11-29 18:58:23 UTC
  • mfrom: (3048 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3189.
  • Revision ID: michael.hudson@canonical.com-20071129185823-vpokl0unnsjib0xw
merge bzr.dev
a bit involved, hope i got it all right!

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    osutils,
33
33
    transactions,
34
34
    xml5,
 
35
    xml6,
35
36
    xml7,
36
37
    )
37
38
 
457
458
 
458
459
 
459
460
class RepositoryFormatKnit3(RepositoryFormatKnit):
460
 
    """Bzr repository knit format 2.
 
461
    """Bzr repository knit format 3.
461
462
 
462
463
    This repository format has:
463
464
     - knits for file texts and inventory
503
504
        return "Knit repository format 3"
504
505
 
505
506
 
 
507
class RepositoryFormatKnit4(RepositoryFormatKnit):
 
508
    """Bzr repository knit format 4.
 
509
 
 
510
    This repository format has everything in format 3, except for
 
511
    tree-references:
 
512
     - knits for file texts and inventory
 
513
     - hash subdirectory based stores.
 
514
     - knits for revisions and signatures
 
515
     - TextStores for revisions and signatures.
 
516
     - a format marker of its own
 
517
     - an optional 'shared-storage' flag
 
518
     - an optional 'no-working-trees' flag
 
519
     - a LockDir lock
 
520
     - support for recording full info about the tree root
 
521
    """
 
522
 
 
523
    repository_class = KnitRepository
 
524
    _commit_builder_class = RootCommitBuilder
 
525
    rich_root_data = True
 
526
    supports_tree_reference = False
 
527
    _serializer = xml6.serializer_v6
 
528
 
 
529
    def _get_matching_bzrdir(self):
 
530
        return bzrdir.format_registry.make_bzrdir('rich-root')
 
531
 
 
532
    def _ignore_setting_bzrdir(self, format):
 
533
        pass
 
534
 
 
535
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
536
 
 
537
    def check_conversion_target(self, target_format):
 
538
        if not target_format.rich_root_data:
 
539
            raise errors.BadConversionTarget(
 
540
                'Does not support rich root data.', target_format)
 
541
 
 
542
    def get_format_string(self):
 
543
        """See RepositoryFormat.get_format_string()."""
 
544
        return 'Bazaar Knit Repository Format 4 (bzr 1.0)\n'
 
545
 
 
546
    def get_format_description(self):
 
547
        """See RepositoryFormat.get_format_description()."""
 
548
        return "Knit repository format 4"
 
549
 
 
550
 
506
551
def _get_stream_as_bytes(knit, required_versions):
507
552
    """Generate a serialised data stream.
508
553