~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/weave_fmt/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-01-14 00:36:56 UTC
  • mto: (5582.12.2 weave-plugin)
  • mto: This revision was merged to the branch mainline in revision 5718.
  • Revision ID: jelmer@samba.org-20110114003656-0enxoqf6lc0yt3d6
Move bzrlib.weavefile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    )
35
35
""")
36
36
from bzrlib import (
37
 
    bzrdir,
38
37
    debug,
39
38
    errors,
40
39
    lockable_files,
44
43
    tuned_gzip,
45
44
    urlutils,
46
45
    versionedfile,
47
 
    weave,
48
 
    weavefile,
49
46
    )
50
47
from bzrlib.decorators import needs_read_lock, needs_write_lock
51
48
from bzrlib.repository import (
63
60
    FulltextContentFactory,
64
61
    VersionedFiles,
65
62
    )
 
63
 
 
64
from bzrlib.plugins.weave_fmt import (
 
65
    weavefile,
 
66
    )
66
67
from bzrlib.plugins.weave_fmt.bzrdir import (
67
68
    BzrDirFormat4,
68
69
    BzrDirFormat5,
69
70
    BzrDirFormat6,
70
71
    )
71
72
 
 
73
 
72
74
class AllInOneRepository(Repository):
73
75
    """Legacy support - the repository behaviour for all-in-one branches."""
74
76
 
393
395
     - TextStores for revisions and signatures.
394
396
    """
395
397
 
396
 
    _versionedfile_class = weave.WeaveFile
 
398
    _versionedfile_class = weavefile.WeaveFile
397
399
    _matchingbzrdir = BzrDirFormat5()
398
400
    supports_funky_characters = False
399
401
 
412
414
    def _get_inventories(self, repo_transport, repo, name='inventory'):
413
415
        mapper = versionedfile.ConstantMapper(name)
414
416
        return versionedfile.ThunkedVersionedFiles(repo_transport,
415
 
            weave.WeaveFile, mapper, repo.is_locked)
 
417
            weavefile.WeaveFile, mapper, repo.is_locked)
416
418
 
417
419
    def _get_revisions(self, repo_transport, repo):
418
420
        return RevisionTextStore(repo_transport.clone('revision-store'),
428
430
        mapper = versionedfile.PrefixMapper()
429
431
        base_transport = repo_transport.clone('weaves')
430
432
        return versionedfile.ThunkedVersionedFiles(base_transport,
431
 
            weave.WeaveFile, mapper, repo.is_locked)
 
433
            weavefile.WeaveFile, mapper, repo.is_locked)
432
434
 
433
435
 
434
436
class RepositoryFormat6(PreSplitOutRepositoryFormat):
440
442
     - TextStores for revisions and signatures.
441
443
    """
442
444
 
443
 
    _versionedfile_class = weave.WeaveFile
 
445
    _versionedfile_class = weavefile.WeaveFile
444
446
    _matchingbzrdir = BzrDirFormat6()
445
447
    supports_funky_characters = False
446
448
 
459
461
    def _get_inventories(self, repo_transport, repo, name='inventory'):
460
462
        mapper = versionedfile.ConstantMapper(name)
461
463
        return versionedfile.ThunkedVersionedFiles(repo_transport,
462
 
            weave.WeaveFile, mapper, repo.is_locked)
 
464
            weavefile.WeaveFile, mapper, repo.is_locked)
463
465
 
464
466
    def _get_revisions(self, repo_transport, repo):
465
467
        return RevisionTextStore(repo_transport.clone('revision-store'),
475
477
        mapper = versionedfile.HashPrefixMapper()
476
478
        base_transport = repo_transport.clone('weaves')
477
479
        return versionedfile.ThunkedVersionedFiles(base_transport,
478
 
            weave.WeaveFile, mapper, repo.is_locked)
 
480
            weavefile.WeaveFile, mapper, repo.is_locked)
479
481
 
480
482
 
481
483
class RepositoryFormat7(MetaDirRepositoryFormat):
490
492
     - an optional 'no-working-trees' flag
491
493
    """
492
494
 
493
 
    _versionedfile_class = weave.WeaveFile
 
495
    _versionedfile_class = weavefile.WeaveFile
494
496
    supports_ghosts = False
495
497
    supports_chks = False
496
498
 
512
514
    def _get_inventories(self, repo_transport, repo, name='inventory'):
513
515
        mapper = versionedfile.ConstantMapper(name)
514
516
        return versionedfile.ThunkedVersionedFiles(repo_transport,
515
 
            weave.WeaveFile, mapper, repo.is_locked)
 
517
            weavefile.WeaveFile, mapper, repo.is_locked)
516
518
 
517
519
    def _get_revisions(self, repo_transport, repo):
518
520
        return RevisionTextStore(repo_transport.clone('revision-store'),
528
530
        mapper = versionedfile.HashPrefixMapper()
529
531
        base_transport = repo_transport.clone('weaves')
530
532
        return versionedfile.ThunkedVersionedFiles(base_transport,
531
 
            weave.WeaveFile, mapper, repo.is_locked)
 
533
            weavefile.WeaveFile, mapper, repo.is_locked)
532
534
 
533
535
    def initialize(self, a_bzrdir, shared=False):
534
536
        """Create a weave repository.