~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-19 09:19:47 UTC
  • mfrom: (5891.1.2 api-docs)
  • Revision ID: pqm@pqm.ubuntu.com-20110519091947-5u0csgddxucufsrm
(spiv) Update 'api-docs' make target to use pydoctor,
 and fix the formatting of many docstrings. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
408
408
class KnitContent(object):
409
409
    """Content of a knit version to which deltas can be applied.
410
410
 
411
 
    This is always stored in memory as a list of lines with \n at the end,
 
411
    This is always stored in memory as a list of lines with \\n at the end,
412
412
    plus a flag saying if the final ending is really there or not, because that
413
413
    corresponds to the on-disk knit representation.
414
414
    """
1155
1155
 
1156
1156
        A dict of key to (record_details, index_memo, next, parents) is
1157
1157
        returned.
1158
 
        method is the way referenced data should be applied.
1159
 
        index_memo is the handle to pass to the data access to actually get the
1160
 
            data
1161
 
        next is the build-parent of the version, or None for fulltexts.
1162
 
        parents is the version_ids of the parents of this version
1163
 
 
1164
 
        :param allow_missing: If True do not raise an error on a missing component,
1165
 
            just ignore it.
 
1158
 
 
1159
        * method is the way referenced data should be applied.
 
1160
        * index_memo is the handle to pass to the data access to actually get
 
1161
          the data
 
1162
        * next is the build-parent of the version, or None for fulltexts.
 
1163
        * parents is the version_ids of the parents of this version
 
1164
 
 
1165
        :param allow_missing: If True do not raise an error on a missing
 
1166
            component, just ignore it.
1166
1167
        """
1167
1168
        component_data = {}
1168
1169
        pending_components = keys
1230
1231
        """Produce a dictionary of knit records.
1231
1232
 
1232
1233
        :return: {key:(record, record_details, digest, next)}
1233
 
            record
1234
 
                data returned from read_records (a KnitContentobject)
1235
 
            record_details
1236
 
                opaque information to pass to parse_record
1237
 
            digest
1238
 
                SHA1 digest of the full text after all steps are done
1239
 
            next
1240
 
                build-parent of the version, i.e. the leftmost ancestor.
 
1234
 
 
1235
            * record: data returned from read_records (a KnitContentobject)
 
1236
            * record_details: opaque information to pass to parse_record
 
1237
            * digest: SHA1 digest of the full text after all steps are done
 
1238
            * next: build-parent of the version, i.e. the leftmost ancestor.
1241
1239
                Will be None if the record is not a delta.
 
1240
 
1242
1241
        :param keys: The keys to build a map for
1243
1242
        :param allow_missing: If some records are missing, rather than
1244
1243
            error, just return the data that could be generated.
1911
1910
        The result will be returned in whatever is the fastest to read.
1912
1911
        Not by the order requested. Also, multiple requests for the same
1913
1912
        record will only yield 1 response.
 
1913
 
1914
1914
        :param records: A list of (key, access_memo) entries
1915
1915
        :return: Yields (key, contents, digest) in the order
1916
1916
                 read, not the order requested
1974
1974
        :param key: The key of the record. Currently keys are always serialised
1975
1975
            using just the trailing component.
1976
1976
        :param dense_lines: The bytes of lines but in a denser form. For
1977
 
            instance, if lines is a list of 1000 bytestrings each ending in \n,
1978
 
            dense_lines may be a list with one line in it, containing all the
1979
 
            1000's lines and their \n's. Using dense_lines if it is already
1980
 
            known is a win because the string join to create bytes in this
1981
 
            function spends less time resizing the final string.
 
1977
            instance, if lines is a list of 1000 bytestrings each ending in
 
1978
            \\n, dense_lines may be a list with one line in it, containing all
 
1979
            the 1000's lines and their \\n's. Using dense_lines if it is
 
1980
            already known is a win because the string join to create bytes in
 
1981
            this function spends less time resizing the final string.
1982
1982
        :return: (len, a StringIO instance with the raw data ready to read.)
1983
1983
        """
1984
1984
        chunks = ["version %s %d %s\n" % (key[-1], len(lines), digest)]