/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: Andrew Bennetts
  • Date: 2008-02-18 08:30:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080218083038-tts55zsx5xrz3l2e
Lots of assorted hackery to reduce the number of imports for common operations.  Improves 'rocks', 'st' and 'help' times by ~50ms on my laptop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
lazy_import(globals(), """
19
19
from bzrlib import (
20
20
    debug,
 
21
    deprecated_graph,
 
22
    xml5,
 
23
    xml6,
 
24
    xml7,
21
25
    )
22
26
from bzrlib.store import revision
23
27
from bzrlib.store.revision.knit import KnitRevisionStore
24
28
""")
25
29
from bzrlib import (
26
30
    bzrdir,
27
 
    deprecated_graph,
28
31
    errors,
29
32
    knit,
30
33
    lockable_files,
32
35
    osutils,
33
36
    symbol_versioning,
34
37
    transactions,
35
 
    xml5,
36
 
    xml6,
37
 
    xml7,
38
38
    )
39
39
 
40
40
from bzrlib.decorators import needs_read_lock, needs_write_lock
351
351
    _commit_builder_class = None
352
352
    # Set this attribute in derived clases to control the _serializer that the
353
353
    # repository objects will have passed to their constructor.
354
 
    _serializer = xml5.serializer_v5
 
354
    @property
 
355
    def _serializer(self):
 
356
        return xml5.serializer_v5
355
357
    # Knit based repositories handle ghosts reasonably well.
356
358
    supports_ghosts = True
357
359
 
468
470
 
469
471
    repository_class = KnitRepository
470
472
    _commit_builder_class = CommitBuilder
471
 
    _serializer = xml5.serializer_v5
 
473
    @property
 
474
    def _serializer(self):
 
475
        return xml5.serializer_v5
472
476
 
473
477
    def __ne__(self, other):
474
478
        return self.__class__ is not other.__class__
505
509
    _commit_builder_class = RootCommitBuilder
506
510
    rich_root_data = True
507
511
    supports_tree_reference = True
508
 
    _serializer = xml7.serializer_v7
 
512
    @property
 
513
    def _serializer(self):
 
514
        return xml7.serializer_v7
509
515
 
510
516
    def _get_matching_bzrdir(self):
511
517
        return bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
552
558
    _commit_builder_class = RootCommitBuilder
553
559
    rich_root_data = True
554
560
    supports_tree_reference = False
555
 
    _serializer = xml6.serializer_v6
 
561
    @property
 
562
    def _serializer(self):
 
563
        return xml6.serializer_v6
556
564
 
557
565
    def _get_matching_bzrdir(self):
558
566
        return bzrdir.format_registry.make_bzrdir('rich-root')