Rev 77: Forgot to add the delta bytes to the index objects. in http://bzr.arbash-meinel.com/plugins/groupcompress_rabin

John Arbash Meinel john at arbash-meinel.com
Mon Mar 2 20:00:22 GMT 2009


At http://bzr.arbash-meinel.com/plugins/groupcompress_rabin

------------------------------------------------------------
revno: 77
revision-id: john at arbash-meinel.com-20090302200018-si0py093o7esxzyd
parent: john at arbash-meinel.com-20090302195421-5j3s3xzr2r8y80bw
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: groupcompress_rabin
timestamp: Mon 2009-03-02 14:00:18 -0600
message:
  Forgot to add the delta bytes to the index objects.
  Also add an assertion to make sure things like that don't get missed.
-------------- next part --------------
=== modified file 'groupcompress.py'
--- a/groupcompress.py	2009-03-02 19:43:37 +0000
+++ b/groupcompress.py	2009-03-02 20:00:18 +0000
@@ -187,12 +187,17 @@
                 new_chunks.insert(0, 'delta\n')
                 new_chunks.append('len:%s\n' % (len(delta),))
             unadded_bytes = sum(map(len, new_chunks))
+            self._delta_index.add_source(delta, unadded_bytes)
             new_chunks.append(delta)
         delta_start = (self.endpoint, len(self.lines))
         self.output_chunks(new_chunks)
         self.input_bytes += input_len
         delta_end = (self.endpoint, len(self.lines))
         self.labels_deltas[key] = (delta_start, delta_end)
+        if not self._delta_index._source_offset == self.endpoint:
+            raise AssertionError('the delta index is out of sync'
+                'with the output lines %s != %s'
+                % (self._delta_index._source_offset, self.endpoint))
         return sha1, self.endpoint
 
     def extract(self, key):



More information about the bazaar-commits mailing list