Part of bzrlib
A knit is a versioned file implementation that supports efficient append only updates.
Knit file layout: lifeless: the data file is made up of "delta records". each delta record has a delta header that contains; (1) a version id, (2) the size of the delta (in lines), and (3) the digest of the -expanded data- (ie, the delta applied to the parent). the delta also ends with a end-marker; simply "end VERSION"
delta can be line or full contents.a ... the 8's there are the index number of the annotation. version robertc@robertcollins.net-20051003014215-ee2990904cc4c7ad 7 c7d23b2a5bd6ca00e8e266cec0ec228158ee9f9e 59,59,3 8 8 if ie.executable: 8 e.set('executable', 'yes') 130,130,2 8 if elt.get('executable') == 'yes': 8 ie.executable = True end robertc@robertcollins.net-20051003014215-ee2990904cc4c7ad
whats in an index: 09:33 < jrydberg> lifeless: each index is made up of a tuple of; version id, options, position, size, parents 09:33 < jrydberg> lifeless: the parents are currently dictionary compressed 09:33 < jrydberg> lifeless: (meaning it currently does not support ghosts) 09:33 < lifeless> right 09:33 < jrydberg> lifeless: the position and size is the range in the data file
so the index sequence is the dictionary compressed sequence number used in the deltas to provide line annotation
Class | KnitAdapter | Base class for knit record adaption. |
Class | FTAnnotatedToUnannotated | An adapter from FT annotated knits to unannotated ones. |
Class | DeltaAnnotatedToUnannotated | An adapter for deltas from annotated to unannotated. |
Class | FTAnnotatedToFullText | An adapter from FT annotated knits to unannotated ones. |
Class | DeltaAnnotatedToFullText | An adapter for deltas from annotated to unannotated. |
Class | FTPlainToFullText | An adapter from FT plain knits to unannotated ones. |
Class | DeltaPlainToFullText | An adapter for deltas from annotated to unannotated. |
Class | KnitContentFactory | Content factory for streaming from knits. |
Class | LazyKnitContentFactory | A ContentFactory which can either generate full text or a wire form. |
Function | knit_delta_closure_to_records | Convert a network record to a iterator over stream records. |
Function | knit_network_to_record | Convert a network record to a record object. |
Class | KnitContent | Content of a knit version to which deltas can be applied. |
Class | AnnotatedKnitContent | Annotated content. |
Class | PlainKnitContent | Unannotated content. |
Class | KnitAnnotateFactory | Factory for creating annotated Content objects. |
Class | KnitPlainFactory | Factory for creating plain Content objects. |
Function | make_file_factory | Create a factory for creating a file based KnitVersionedFiles. |
Function | make_pack_factory | Create a factory for creating a pack based VersionedFiles. |
Function | cleanup_pack_knit | Undocumented |
Class | KnitVersionedFiles | Storage for many versioned files using knit compression. |
Function | annotate_knit | Annotate a knit with no cached annotations. |
Class | _KnitFactory | Base class for common Factory functions. |
Function | _get_total_build_size | Determine the total bytes to build these keys. |
Class | _ContentMapGenerator | Generate texts or expose raw deltas for a set of texts. |
Class | _VFContentMapGenerator | Content map generator reading from a VersionedFiles object. |
Class | _NetworkContentMapGenerator | Content map generator sourced from a network stream. |
Class | _KndxIndex | Manages knit index files |
Class | _KnitGraphIndex | A KnitVersionedFiles index layered on GraphIndex. |
Class | _KnitKeyAccess | Access to records in .knit files. |
Class | _KnitAnnotator | Build up the annotations for a text. |
Parameters | storage_kind | The storage kind of the record. Must be 'knit-delta-closure'. |
bytes | The bytes of the record on the network. |
Parameters | storage_kind | The storage kind of the record. |
bytes | The bytes of the record on the network. |
This is only functional enough to run interface tests, it doesn't try to provide a full pack environment.
Parameters | annotated | knit annotations are wanted. |
mapper | The mapper from keys to paths. |
This is only functional enough to run interface tests, it doesn't try to provide a full pack environment.
Parameters | graph | Store a graph. |
delta | Delta compress contents. | |
keylength | How long should keys be. |
(helper function because _KnitGraphIndex and _KndxIndex work the same, but don't inherit from a common base.)
Parameters | keys | Keys that we want to build |
positions | dict of {key, (info, index_memo, comp_parent)} (such as returned by _get_components_positions) | |
Returns | Number of bytes to build those keys |