At http://bzr.arbash-meinel.com/plugins/groupcompress_rabin
------------------------------------------------------------
revno: 63
revision-id: [email protected]
parent: [email protected]
committer: John Arbash Meinel <[email protected]>
branch nick: groupcompress_rabin
timestamp: Fri 2009-02-27 22:28:02 -0600
message:
Handle when self._index is NULL, mostly because the source text was the empty
strig.
Start using DeltaIndex as part of the stardard compressing.
=== modified file '_groupcompress_c.pyx'
--- a/_groupcompress_c.pyx 2009-02-28 04:24:48 +0000
+++ b/_groupcompress_c.pyx 2009-02-28 04:28:02 +0000
@@ -127,7 +127,8 @@
cdef void * delta
cdef unsigned long delta_size
- assert self._index != NULL
+ if self._index == NULL:
+ return None
if not PyString_CheckExact(target_bytes):
raise TypeError('target is not a str')
=== modified file 'groupcompress.py'
--- a/groupcompress.py 2009-02-28 04:00:12 +0000
+++ b/groupcompress.py 2009-02-28 04:28:02 +0000
@@ -52,7 +52,7 @@
VersionedFiles,
)
-_NO_LABELS = True
+_NO_LABELS = False
def parse(bytes):
if _NO_LABELS:
@@ -173,7 +173,8 @@
# we could try a delta against whatever the last delta we
# computed, (the idea being we just computed the delta_index, so
# we re-use it here, and see if that is good enough, etc)
- delta = _groupcompress_c.make_delta(source_text, target_text)
+ delta_index = _groupcompress_c.DeltaIndex(source_text)
+ delta = delta_index.make_delta(target_text)
if (delta is None
or len(delta) > len(target_text) / 2):
# We can't delta (perhaps source_text is empty)
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits