~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revfile.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-09 06:00:35 UTC
  • Revision ID: mbp@sourcefrog.net-20050409060035-979035a2ca0edeab773254eb
doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
balanced tree indexed by SHA1 so we can much more efficiently find the
62
62
index associated with a particular hash.  For 100,000 revs we would be
63
63
able to find it in about 17 random reads, which is not too bad.
 
64
 
 
65
This performs pretty well except when trying to calculate deltas of
 
66
really large files.  For that the main thing would be to plug in
 
67
something faster than difflib, which is after all pure Python.
 
68
Another approach is to just store the gzipped full text of big files,
 
69
though perhaps that's too perverse?
64
70
"""
65
71
 
66
72
 
73
79
# TODO: Some kind of faster lookup of SHAs?  The bad thing is that probably means
74
80
# rewriting existing records, which is not so nice.
75
81
 
 
82
# TODO: Something to check that regions identified in the index file
 
83
# completely butt up and do not overlap.  Strictly it's not a problem
 
84
# if there are gaps and that can happen if we're interrupted while
 
85
# writing to the datafile.  Overlapping would be very bad though.
 
86
 
 
87
 
76
88
 
77
89
import sys, zlib, struct, mdiff, stat, os, sha
78
90
from binascii import hexlify, unhexlify