Rev 50: Make it clear that the bits you get from 'apply_delta' are chunks, not lines. in http://bazaar.launchpad.net/%7Ebzr/bzr-groupcompress/trunk

John Arbash Meinel john at arbash-meinel.com
Fri Feb 27 03:35:28 GMT 2009


At http://bazaar.launchpad.net/%7Ebzr/bzr-groupcompress/trunk

------------------------------------------------------------
revno: 50
revision-id: john at arbash-meinel.com-20090227033445-gk1o5rr6t0u0d14i
parent: john at arbash-meinel.com-20090227032810-wughh2jot1eiq94b
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Thu 2009-02-26 21:34:45 -0600
message:
  Make it clear that the bits you get from 'apply_delta' are chunks, not lines.
-------------- next part --------------
=== modified file 'groupcompress.py'
--- a/groupcompress.py	2009-02-27 03:28:10 +0000
+++ b/groupcompress.py	2009-02-27 03:34:45 +0000
@@ -282,9 +282,9 @@
         if label != key:
             raise AssertionError("wrong key: %r, wanted %r" % (label, key))
         # Perhaps we want to keep the line offsets too in memory at least?
-        lines = apply_delta(''.join(self.lines), delta)
-        sha1 = sha_strings(lines)
-        return lines, sha1
+        chunks = apply_delta(''.join(self.lines), delta)
+        sha1 = sha_strings(chunks)
+        return chunks, sha1
 
     def flush_multi(self, instructions, lines, new_lines, index_lines):
         """Flush a bunch of different ranges out.
@@ -639,11 +639,11 @@
                 label, sha1, delta = parse(delta_lines)
                 if label != key:
                     raise AssertionError("wrong key: %r, wanted %r" % (label, key))
-                lines = apply_delta(plain, delta)
+                chunks = apply_delta(plain, delta)
                 ## sha1 = sha_strings(lines)
-                if sha_strings(lines) != sha1:
+                if sha_strings(chunks) != sha1:
                     raise AssertionError('sha1 sum did not match')
-            yield ChunkedContentFactory(key, parents, sha1, lines)
+            yield ChunkedContentFactory(key, parents, sha1, chunks)
 
     def get_sha1s(self, keys):
         """See VersionedFiles.get_sha1s()."""



More information about the bazaar-commits mailing list