~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Martin Pool
  • Date: 2007-10-24 04:56:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: mbp@sourcefrog.net-20071024045601-m2uui0mpepncnegz
Review cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
    to provide a knit access layer, and allows having up to one writable
393
393
    index within the collection.
394
394
    """
 
395
    # XXX: Probably 'can be written to' could/should be separated from 'acts
 
396
    # like a knit index' -- mbp 20071024
395
397
 
396
398
    def __init__(self):
397
399
        """Create an AggregateIndex."""
435
437
 
436
438
    def add_writable_index(self, index, pack):
437
439
        """Add an index which is able to have data added to it.
 
440
 
 
441
        There can be at most one writable index at any time.  Any
 
442
        modifications made to the knit are put into this index.
438
443
        
439
444
        :param index: An index from the pack parameter.
440
445
        :param pack: A Pack instance.
507
512
        
508
513
        :param pack: A Pack object.
509
514
        """
 
515
        assert pack.name not in self._packs_by_name
510
516
        self.packs.append(pack)
511
 
        assert pack.name not in self._packs_by_name
512
517
        self._packs_by_name[pack.name] = pack
513
518
        self.revision_index.add_index(pack.revision_index, pack)
514
519
        self.inventory_index.add_index(pack.inventory_index, pack)
781
786
 
782
787
        :param existing_packs: The packs to pack. (A list of (revcount, Pack)
783
788
            tuples).
784
 
        :parma pack_distribution: A list with the number of revisions desired
 
789
        :param pack_distribution: A list with the number of revisions desired
785
790
            in each pack.
786
791
        """
787
792
        if len(existing_packs) <= len(pack_distribution):