~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Robert Collins
  • Date: 2007-09-12 06:33:40 UTC
  • mto: (2592.5.3 pack-repository)
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: robertc@robertcollins.net-20070912063340-rebmp08maq9lmiyl
Do not create many transient knit objects, saving 4% on commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
 
256
256
class KnitRepository3(KnitRepository):
257
257
 
 
258
    # knit3 repositories need a RootCommitBuilder
 
259
    _commit_builder_class = RootCommitBuilder
 
260
 
258
261
    def __init__(self, _format, a_bzrdir, control_files, _revision_store,
259
262
                 control_store, text_store):
260
263
        KnitRepository.__init__(self, _format, a_bzrdir, control_files,
281
284
        assert inv.root.revision is not None
282
285
        return KnitRepository.serialise_inventory(self, inv)
283
286
 
284
 
    def get_commit_builder(self, branch, parents, config, timestamp=None,
285
 
                           timezone=None, committer=None, revprops=None,
286
 
                           revision_id=None):
287
 
        """Obtain a CommitBuilder for this repository.
288
 
        
289
 
        :param branch: Branch to commit to.
290
 
        :param parents: Revision ids of the parents of the new revision.
291
 
        :param config: Configuration to use.
292
 
        :param timestamp: Optional timestamp recorded for commit.
293
 
        :param timezone: Optional timezone for timestamp.
294
 
        :param committer: Optional committer to set for commit.
295
 
        :param revprops: Optional dictionary of revision properties.
296
 
        :param revision_id: Optional revision id.
297
 
        """
298
 
        revision_id = osutils.safe_revision_id(revision_id)
299
 
        result = RootCommitBuilder(self, parents, config, timestamp, timezone,
300
 
                                 committer, revprops, revision_id)
301
 
        self.start_write_group()
302
 
        return result
303
 
 
304
287
 
305
288
class RepositoryFormatKnit(MetaDirRepositoryFormat):
306
289
    """Bzr repository knit format (generalized).