/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/pack_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-02 17:07:16 UTC
  • mto: This revision was merged to the branch mainline in revision 5844.
  • Revision ID: jelmer@samba.org-20110502170716-mp5l2k4l4m5b3cw6
split out versionedfile-specific stuff from commitbuilder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    )
53
53
from bzrlib.lock import LogicalLockResult
54
54
from bzrlib.repository import (
55
 
    CommitBuilder,
56
55
    MetaDirRepository,
57
56
    MetaDirRepositoryFormat,
58
57
    RepositoryFormat,
59
58
    RepositoryWriteLockResult,
60
 
    RootCommitBuilder,
61
59
    )
62
60
from bzrlib.vf_repository import (
63
61
    MetaDirVersionedFileRepository,
 
62
    VersionedFileCommitBuilder,
 
63
    VersionedFileRootCommitBuilder,
64
64
    )
65
65
from bzrlib.trace import (
66
66
    mutter,
69
69
    )
70
70
 
71
71
 
72
 
class PackCommitBuilder(CommitBuilder):
73
 
    """A subclass of CommitBuilder to add texts with pack semantics.
 
72
class PackCommitBuilder(VersionedFileCommitBuilder):
 
73
    """Subclass of VersionedFileCommitBuilder to add texts with pack semantics.
74
74
 
75
75
    Specifically this uses one knit object rather than one knit object per
76
76
    added text, reducing memory and object pressure.
79
79
    def __init__(self, repository, parents, config, timestamp=None,
80
80
                 timezone=None, committer=None, revprops=None,
81
81
                 revision_id=None, lossy=False):
82
 
        CommitBuilder.__init__(self, repository, parents, config,
 
82
        VersionedFileCommitBuilder.__init__(self, repository, parents, config,
83
83
            timestamp=timestamp, timezone=timezone, committer=committer,
84
84
            revprops=revprops, revision_id=revision_id, lossy=lossy)
85
85
        self._file_graph = graph.Graph(
90
90
        return set([key[1] for key in self._file_graph.heads(keys)])
91
91
 
92
92
 
93
 
class PackRootCommitBuilder(RootCommitBuilder):
 
93
class PackRootCommitBuilder(VersionedFileRootCommitBuilder):
94
94
    """A subclass of RootCommitBuilder to add texts with pack semantics.
95
95
 
96
96
    Specifically this uses one knit object rather than one knit object per
100
100
    def __init__(self, repository, parents, config, timestamp=None,
101
101
                 timezone=None, committer=None, revprops=None,
102
102
                 revision_id=None, lossy=False):
103
 
        CommitBuilder.__init__(self, repository, parents, config,
104
 
            timestamp=timestamp, timezone=timezone, committer=committer,
105
 
            revprops=revprops, revision_id=revision_id, lossy=lossy)
 
103
        super(PackRootCommitBuilder, self).__init__(repository, parents,
 
104
            config, timestamp=timestamp, timezone=timezone,
 
105
            committer=committer, revprops=revprops, revision_id=revision_id,
 
106
            lossy=lossy)
106
107
        self._file_graph = graph.Graph(
107
108
            repository._pack_collection.text_index.combined_index)
108
109