Module b.knit

Part of bzrlib

Knit versionedfile implementation.

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

Line # Kind Name Docs
136 Class KnitAdapter Base class for knit record adaption.
151 Class FTAnnotatedToUnannotated An adapter from FT annotated knits to unannotated ones.
162 Class DeltaAnnotatedToUnannotated An adapter for deltas from annotated to unannotated.
175 Class FTAnnotatedToFullText An adapter from FT annotated knits to unannotated ones.
186 Class DeltaAnnotatedToFullText An adapter for deltas from annotated to unannotated.
208 Class FTPlainToFullText An adapter from FT plain knits to unannotated ones.
219 Class DeltaPlainToFullText An adapter for deltas from annotated to unannotated.
241 Class KnitContentFactory Content factory for streaming from knits.
286 Class KnitContent Content of a knit version to which deltas can be applied.
342 Class AnnotatedKnitContent Annotated content.
383 Class PlainKnitContent Unannotated content.
454 Class KnitAnnotateFactory Factory for creating annotated Content objects.
578 Class KnitPlainFactory Factory for creating plain Content objects.
641 Function make_file_factory Create a factory for creating a file based KnitVersionedFiles.
657 Function make_pack_factory Create a factory for creating a pack based VersionedFiles.
694 Function cleanup_pack_knit Undocumented
699 Class KnitVersionedFiles Storage for many versioned files using knit compression.
2591 Function annotate_knit Annotate a knit with no cached annotations.
420 Class _KnitFactory Base class for common Factory functions.
1749 Class _KndxIndex Manages knit index files
2129 Class _KnitGraphIndex A KnitVersionedFiles index layered on GraphIndex.
2384 Class _KnitKeyAccess Access to records in .knit files.
2459 Class _DirectPackAccess Access to data in one or more packs with less translation.
2602 Class _KnitAnnotator Build up the annotations for a text.
def make_file_factory(annotated, mapper):
Create a factory for creating a file based KnitVersionedFiles.

This is only functional enough to run interface tests, it doesn't try to provide a full pack environment.

Parametersannotatedknit annotations are wanted.
mapperThe mapper from keys to paths.
def make_pack_factory(graph, delta, keylength):
Create a factory for creating a pack based VersionedFiles.

This is only functional enough to run interface tests, it doesn't try to provide a full pack environment.

ParametersgraphStore a graph.
deltaDelta compress contents.
keylengthHow long should keys be.
def cleanup_pack_knit(versioned_files):
Undocumented
def annotate_knit(knit, revision_id):
Annotate a knit with no cached annotations.

This implementation is for knits with no cached annotations. It will work for knits with cached annotations, but this is not recommended.

API Documentation for BzrLib, generated by pydoctor at 2008-12-03 00:00:12.