~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Aaron Bentley
  • Date: 2006-06-12 02:11:45 UTC
  • mfrom: (1759.2.2 integration)
  • mto: This revision was merged to the branch mainline in revision 1767.
  • Revision ID: aaron.bentley@utoronto.ca-20060612021145-0ced20f7791f3c66
Fix some typos (found using aspell) (Jelmer Vernooij).

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
# TODO: Can we put in some kind of value to check that the index and data
90
90
# files belong together?
91
91
 
92
 
# TODO: accomodate binaries, perhaps by storing a byte count
 
92
# TODO: accommodate binaries, perhaps by storing a byte count
93
93
 
94
94
# TODO: function to check whole file
95
95
 
172
172
        intstart intend intcount
173
173
        1..count lines:
174
174
        revid(utf8) newline\n
175
 
        internal represnetation is
 
175
        internal representation is
176
176
        (start, end, count, [1..count tuples (revid, newline)])
177
177
        """
178
178
        result = []
362
362
        :param records: A list of tuples(version_id, options, parents, size).
363
363
        :param data: The data for the records. When it is written, the records
364
364
                     are adjusted to have pos pointing into data by the sum of
365
 
                     the preceeding records sizes.
 
365
                     the preceding records sizes.
366
366
        """
367
367
        # write all the data
368
368
        pos = self._data.add_raw_record(data)
728
728
        """See VersionedFile.iter_lines_added_or_present_in_versions()."""
729
729
        if version_ids is None:
730
730
            version_ids = self.versions()
731
 
        # we dont care about inclusions, the caller cares.
 
731
        # we don't care about inclusions, the caller cares.
732
732
        # but we need to setup a list of records to visit.
733
733
        # we need version_id, position, length
734
734
        version_id_records = []
932
932
 
933
933
    The index file on disc contains a header, followed by one line per knit
934
934
    record. The same revision can be present in an index file more than once.
935
 
    The first occurence gets assigned a sequence number starting from 0. 
 
935
    The first occurrence gets assigned a sequence number starting from 0. 
936
936
    
937
937
    The format of a single line is
938
938
    REVISION_ID FLAGS BYTE_OFFSET LENGTH( PARENT_ID|PARENT_SEQUENCE_ID)* :\n
954
954
    the end of the file, then the record that is missing it will be ignored by
955
955
    the parser.
956
956
 
957
 
    When writing new records to the index file, the data is preceeded by '\n'
 
957
    When writing new records to the index file, the data is preceded by '\n'
958
958
    to ensure that records always start on new lines even if the last write was
959
959
    interrupted. As a result its normal for the last line in the index to be
960
960
    missing a trailing newline. One can be added with no harmful effects.
991
991
        self._cache = {}
992
992
        # position in _history is the 'official' index for a revision
993
993
        # but the values may have come from a newer entry.
994
 
        # so - wc -l of a knit index is != the number of uniqe names
 
994
        # so - wc -l of a knit index is != the number of unique names
995
995
        # in the weave.
996
996
        self._history = []
997
997
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
1213
1213
                if parent in self._cache]
1214
1214
 
1215
1215
    def get_parents_with_ghosts(self, version_id):
1216
 
        """Return parents of specified version wth ghosts."""
 
1216
        """Return parents of specified version with ghosts."""
1217
1217
        return self._cache[version_id][4] 
1218
1218
 
1219
1219
    def check_versions_present(self, version_ids):
1374
1374
 
1375
1375
        if len(needed_records):
1376
1376
            # We take it that the transport optimizes the fetching as good
1377
 
            # as possible (ie, reads continous ranges.)
 
1377
            # as possible (ie, reads continuous ranges.)
1378
1378
            response = self._transport.readv(self._filename,
1379
1379
                [(pos, size) for version_id, pos, size in needed_records])
1380
1380
 
1469
1469
                    # if source has the parent, we must :
1470
1470
                    # * already have it or
1471
1471
                    # * have it scheduled already
1472
 
                    # otherwise we dont care
 
1472
                    # otherwise we don't care
1473
1473
                    assert (self.target.has_version(parent) or
1474
1474
                            parent in copy_set or
1475
1475
                            not self.source.has_version(parent))
1680
1680
            j2lenget = j2len.get
1681
1681
            newj2len = {}
1682
1682
            
1683
 
            # changing b2j.get(a[i], nothing) to a try:Keyerror pair produced the
 
1683
            # changing b2j.get(a[i], nothing) to a try:KeyError pair produced the
1684
1684
            # following improvement
1685
1685
            #     704  0   4650.5320   2620.7410   bzrlib.knit:1336(find_longest_match)
1686
1686
            # +326674  0   1655.1210   1655.1210   +<method 'get' of 'dict' objects>