22
22
A knit is a versioned file implementation that supports efficient append only
26
lifeless: the data file is made up of "delta records". each delta record has a delta header
27
that contains; (1) a version id, (2) the size of the delta (in lines), and (3) the digest of
28
the -expanded data- (ie, the delta applied to the parent). the delta also ends with a
29
end-marker; simply "end VERSION"
31
delta can be line or full contents.a
32
... the 8's there are the index number of the annotation.
33
version robertc@robertcollins.net-20051003014215-ee2990904cc4c7ad 7 c7d23b2a5bd6ca00e8e266cec0ec228158ee9f9e
37
8 e.set('executable', 'yes')
39
8 if elt.get('executable') == 'yes':
40
8 ie.executable = True
41
end robertc@robertcollins.net-20051003014215-ee2990904cc4c7ad
45
09:33 < jrydberg> lifeless: each index is made up of a tuple of; version id, options, position, size, parents
46
09:33 < jrydberg> lifeless: the parents are currently dictionary compressed
47
09:33 < jrydberg> lifeless: (meaning it currently does not support ghosts)
48
09:33 < lifeless> right
49
09:33 < jrydberg> lifeless: the position and size is the range in the data file
52
so the index sequence is the dictionary compressed sequence number used
53
in the deltas to provide line annotation
58
# 10:16 < lifeless> make partial index writes safe
59
# 10:16 < lifeless> implement 'knit.check()' like weave.check()
60
# 10:17 < lifeless> record known ghosts so we can detect when they are filled in rather than the current 'reweave
28
65
from difflib import SequenceMatcher
66
from gzip import GzipFile
68
from StringIO import StringIO
30
70
from bzrlib.errors import FileExists, NoSuchFile, KnitError, \
31
71
InvalidRevisionId, KnitCorrupt, KnitHeaderError, \
36
76
from bzrlib.versionedfile import VersionedFile
37
77
from bzrlib.tsort import topo_sort
39
from StringIO import StringIO
40
from gzip import GzipFile
43
80
# TODO: Split out code specific to this format into an associated object.
520
557
# We take the short path here, and extract all relevant texts
521
558
# and put them in a weave and let that do all the work. Far
522
559
# from optimal, but is much simpler.
560
# FIXME RB 20060228 this really is inefficient!
523
561
from bzrlib.weave import Weave
525
563
w = Weave(self.filename)