~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-16 10:11:51 UTC
  • mfrom: (5757.6.11 knitpackrepo-5)
  • Revision ID: pqm@pqm.ubuntu.com-20110416101151-adka24z3gayoxml7
(jelmer) Make PackRepository subclass MetaDirRepository rather than
 KnitRepository. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    lockdir,
51
51
    )
52
52
 
53
 
from bzrlib.decorators import needs_write_lock, only_raises
 
53
from bzrlib.decorators import (
 
54
    needs_read_lock,
 
55
    needs_write_lock,
 
56
    only_raises,
 
57
    )
54
58
from bzrlib.lock import LogicalLockResult
55
 
from bzrlib.repofmt.knitrepo import KnitRepository
56
59
from bzrlib.repository import (
57
60
    CommitBuilder,
 
61
    MetaDirRepository,
58
62
    MetaDirRepositoryFormat,
59
63
    RepositoryFormat,
60
64
    RepositoryWriteLockResult,
2060
2064
            self._resume_pack(token)
2061
2065
 
2062
2066
 
2063
 
class PackRepository(KnitRepository):
 
2067
class PackRepository(MetaDirRepository):
2064
2068
    """Repository with knit objects stored inside pack containers.
2065
2069
 
2066
2070
    The layering for a KnitPackRepository is:
2085
2089
 
2086
2090
    """
2087
2091
 
 
2092
    # These attributes are inherited from the Repository base class. Setting
 
2093
    # them to None ensures that if the constructor is changed to not initialize
 
2094
    # them, or a subclass fails to call the constructor, that an error will
 
2095
    # occur rather than the system working but generating incorrect data.
 
2096
    _commit_builder_class = None
 
2097
    _serializer = None
 
2098
 
 
2099
    def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
 
2100
        _serializer):
 
2101
        MetaDirRepository.__init__(self, _format, a_bzrdir, control_files)
 
2102
        self._commit_builder_class = _commit_builder_class
 
2103
        self._serializer = _serializer
 
2104
        self._reconcile_fixes_text_parents = True
 
2105
 
 
2106
    @needs_read_lock
 
2107
    def _all_revision_ids(self):
 
2108
        """See Repository.all_revision_ids()."""
 
2109
        return [key[0] for key in self.revisions.keys()]
 
2110
 
2088
2111
    def _abort_write_group(self):
2089
2112
        self.revisions._index._key_dependencies.clear()
2090
2113
        self._pack_collection._abort_write_group()