~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-27 22:29:55 UTC
  • mto: (3735.39.2 clean)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090327222955-utifmfm888zerixt
Implement apply_delta_to_source which doesn't have to malloc another string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
        if end != content_start + content_len:
249
249
            raise ValueError('end != len according to field header'
250
250
                ' %s != %s' % (end, content_start + content_len))
251
 
        content = self._content[content_start:end]
252
251
        if c == 'f':
253
 
            bytes = content
 
252
            bytes = self._content[content_start:end]
254
253
        elif c == 'd':
255
 
            bytes = apply_delta(self._content, content)
 
254
            bytes = apply_delta_to_source(self._content, content_start, end)
256
255
        return bytes
257
256
 
258
257
    def set_content(self, content):
1641
1640
 
1642
1641
from bzrlib._groupcompress_py import (
1643
1642
    apply_delta,
 
1643
    apply_delta_to_source,
1644
1644
    encode_base128_int,
1645
1645
    decode_base128_int,
1646
1646
    LinesDeltaIndex,
1648
1648
try:
1649
1649
    from bzrlib._groupcompress_pyx import (
1650
1650
        apply_delta,
 
1651
        apply_delta_to_source,
1651
1652
        DeltaIndex,
1652
1653
        encode_base128_int,
1653
1654
        decode_base128_int,