Rev 3241: Clean up some variable ordering to make more sense. in http://bzr.arbash-meinel.com/branches/bzr/1.3-dev/annotate_cleanup

John Arbash Meinel john at arbash-meinel.com
Wed Mar 5 17:51:32 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.3-dev/annotate_cleanup

------------------------------------------------------------
revno: 3241
revision-id:john at arbash-meinel.com-20080305174846-mlcmszy3gbntuowj
parent: john at arbash-meinel.com-20080305173514-933wremo23r9doex
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: annotate_cleanup
timestamp: Wed 2008-03-05 17:48:46 +0000
message:
  Clean up some variable ordering to make more sense.
modified:
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
-------------- next part --------------
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2008-03-05 17:30:58 +0000
+++ b/bzrlib/knit.py	2008-03-05 17:48:46 +0000
@@ -1109,23 +1109,26 @@
     def _get_record_map(self, version_ids):
         """Produce a dictionary of knit records.
         
-        The keys are version_ids, the values are tuples of (record_details,
-        content, digest, next).
-        method is the way the content should be applied.  
-        content is a KnitContent object.
-        digest is the SHA1 digest of this version id after all steps are done
-        next is the build-parent of the version, i.e. the leftmost ancestor.
-        If the method is fulltext, next will be None.
+        :return: {version_id:(record, record_details, digest, next)}
+            record
+                data returned from read_records
+            record_details
+                opaque information to pass to parse_record
+            digest
+                SHA1 digest of the full text after all steps are done
+            next
+                build-parent of the version, i.e. the leftmost ancestor.
+                Will be None if the record is not a delta.
         """
         position_map = self._get_components_positions(version_ids)
         # c = component_id, r = record_details, i_m = index_memo, n = next
         records = [(c, i_m) for c, (r, i_m, n)
                              in position_map.iteritems()]
         record_map = {}
-        for component_id, content, digest in \
+        for component_id, record, digest in \
                 self._data.read_records_iter(records):
             (record_details, index_memo, next) = position_map[component_id]
-            record_map[component_id] = record_details, content, digest, next
+            record_map[component_id] = record, record_details, digest, next
 
         return record_map
 
@@ -1167,20 +1170,20 @@
             components = []
             cursor = version_id
             while cursor is not None:
-                record_details, data, digest, next = record_map[cursor]
-                components.append((cursor, record_details, data, digest))
+                record, record_details, digest, next = record_map[cursor]
+                components.append((cursor, record, record_details, digest))
                 if cursor in content_map:
                     break
                 cursor = next
 
             content = None
-            for (component_id, record_details, data,
+            for (component_id, record, record_details,
                  digest) in reversed(components):
                 if component_id in content_map:
                     content = content_map[component_id]
                 else:
                     content, delta = self.factory.parse_record(version_id,
-                        data, record_details, content,
+                        record, record_details, content,
                         copy_base_content=multiple_versions)
                     if multiple_versions:
                         content_map[component_id] = content



More information about the bazaar-commits mailing list