~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-09 15:39:14 UTC
  • mfrom: (5815.4.22 separate-vf)
  • Revision ID: pqm@pqm.ubuntu.com-20110509153914-wbwvbi34ohzwpv9k
(jelmer) Split VersionedFiles-specific bits out of bzrlib.repository into
 bzrlib.vf_repository. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    )
50
50
from bzrlib.decorators import needs_read_lock, needs_write_lock
51
51
from bzrlib.repository import (
52
 
    CommitBuilder,
53
52
    InterRepository,
54
 
    InterSameDataRepository,
55
 
    MetaDirVersionedFileRepository,
56
 
    MetaDirRepositoryFormat,
57
 
    Repository,
58
53
    RepositoryFormat,
59
54
    )
60
55
from bzrlib.store.text import TextStore
63
58
    FulltextContentFactory,
64
59
    VersionedFiles,
65
60
    )
 
61
from bzrlib.vf_repository import (
 
62
    InterSameDataRepository,
 
63
    VersionedFileCommitBuilder,
 
64
    VersionedFileRepository,
 
65
    VersionedFileRepositoryFormat,
 
66
    MetaDirVersionedFileRepository,
 
67
    MetaDirVersionedFileRepositoryFormat,
 
68
    )
66
69
 
67
70
from bzrlib.plugins.weave_fmt import bzrdir as weave_bzrdir
68
71
 
69
72
 
70
 
class AllInOneRepository(Repository):
 
73
class AllInOneRepository(VersionedFileRepository):
71
74
    """Legacy support - the repository behaviour for all-in-one branches."""
72
75
 
73
76
    @property
147
150
                           timezone=None, committer=None, revprops=None,
148
151
                           revision_id=None, lossy=False):
149
152
        self._check_ascii_revisionid(revision_id, self.get_commit_builder)
150
 
        result = CommitBuilder(self, parents, config, timestamp, timezone,
151
 
                              committer, revprops, revision_id, lossy=lossy)
 
153
        result = VersionedFileCommitBuilder(self, parents, config, timestamp,
 
154
            timezone, committer, revprops, revision_id, lossy=lossy)
152
155
        self.start_write_group()
153
156
        return result
154
157
 
236
239
                           timezone=None, committer=None, revprops=None,
237
240
                           revision_id=None, lossy=False):
238
241
        self._check_ascii_revisionid(revision_id, self.get_commit_builder)
239
 
        result = CommitBuilder(self, parents, config, timestamp, timezone,
240
 
                              committer, revprops, revision_id, lossy=lossy)
 
242
        result = VersionedFileCommitBuilder(self, parents, config, timestamp,
 
243
            timezone, committer, revprops, revision_id, lossy=lossy)
241
244
        self.start_write_group()
242
245
        return result
243
246
 
259
262
            check_content=check_content)[0]
260
263
 
261
264
 
262
 
class PreSplitOutRepositoryFormat(RepositoryFormat):
 
265
class PreSplitOutRepositoryFormat(VersionedFileRepositoryFormat):
263
266
    """Base class for the pre split out repository formats."""
264
267
 
265
268
    rich_root_data = False
271
274
    _fetch_reconcile = True
272
275
    fast_deltas = False
273
276
    supports_leaving_lock = False
274
 
    supports_full_versioned_files = True
275
277
    # XXX: This is an old format that we don't support full checking on, so
276
278
    # just claim that checking for this inconsistency is not required.
277
279
    revision_graph_can_have_wrong_parents = False
428
430
        return versionedfile.ThunkedVersionedFiles(base_transport,
429
431
            weave.WeaveFile, mapper, repo.is_locked)
430
432
 
431
 
    def _get_extra_interrepo_test_combinations(self):
432
 
        from bzrlib.repofmt import knitrepo
433
 
        return [(InterRepository, RepositoryFormat5(),
434
 
            knitrepo.RepositoryFormatKnit3())]
435
 
 
436
433
 
437
434
class RepositoryFormat6(PreSplitOutRepositoryFormat):
438
435
    """Bzr control format 6.
480
477
            weave.WeaveFile, mapper, repo.is_locked)
481
478
 
482
479
 
483
 
class RepositoryFormat7(MetaDirRepositoryFormat):
 
480
class RepositoryFormat7(MetaDirVersionedFileRepositoryFormat):
484
481
    """Bzr repository 7.
485
482
 
486
483
    This repository format has:
496
493
    supports_ghosts = False
497
494
    supports_chks = False
498
495
    supports_funky_characters = False
499
 
    supports_full_versioned_files = True
500
496
    revision_graph_can_have_wrong_parents = False
501
497
 
502
498
    _fetch_order = 'topological'
634
630
                    record, record.get_bytes_as(record.storage_kind)))
635
631
                try:
636
632
                    self.add_lines(record.key, None, lines)
637
 
                except RevisionAlreadyPresent:
 
633
                except errors.RevisionAlreadyPresent:
638
634
                    pass
639
635
 
640
636
    def _load_text(self, key):