~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-28 04:28:02 UTC
  • mto: (0.23.23 groupcompress_rabin)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090228042802-joang5uih4qcf45p
Handle when self._index is NULL, mostly because the source text was the empty strig.
Start using DeltaIndex as part of the stardard compressing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    VersionedFiles,
53
53
    )
54
54
 
55
 
_NO_LABELS = True
 
55
_NO_LABELS = False
56
56
 
57
57
def parse(bytes):
58
58
    if _NO_LABELS:
173
173
        #      we could try a delta against whatever the last delta we
174
174
        #      computed, (the idea being we just computed the delta_index, so
175
175
        #      we re-use it here, and see if that is good enough, etc)
176
 
        delta = _groupcompress_c.make_delta(source_text, target_text)
 
176
        delta_index = _groupcompress_c.DeltaIndex(source_text)
 
177
        delta = delta_index.make_delta(target_text)
177
178
        if (delta is None
178
179
            or len(delta) > len(target_text) / 2):
179
180
            # We can't delta (perhaps source_text is empty)