At http://bzr.arbash-meinel.com/branches/bzr/1.11/sorted_get_record_stream

------------------------------------------------------------
revno: 3881
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: sorted_get_record_stream
timestamp: Fri 2008-12-05 07:11:10 -0600
message:
  Add a comment about what data we are sorting by.
=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py    2008-12-04 20:59:15 +0000
+++ b/bzrlib/knit.py    2008-12-05 13:11:10 +0000
@@ -2139,14 +2139,14 @@
             _get_components_positions()
         :return: None
         """
-        def get_index_memo(key):
+        def get_sort_key(key):
             index_memo = positions[key][1]
             # Group by prefix and position. index_memo[0] is the key, so it is
             # (file_id, revision_id) and we don't want to sort on revision_id,
             # index_memo[1] is the position, and index_memo[2] is the size,
             # which doesn't matter for the sort
             return index_memo[0][:-1], index_memo[1]
-        return keys.sort(key=get_index_memo)
+        return keys.sort(key=get_sort_key)
 
     def _split_key(self, key):
         """Split key into a prefix and suffix."""
@@ -2419,6 +2419,11 @@
         :return: None
         """
         def get_index_memo(key):
+            # index_memo is at offset [1]. It is made up of (GraphIndex,
+            # position, size). GI is an object, which will be unique for each
+            # pack file. This causes us to group by pack file, then sort by
+            # position. Size doesn't matter, but it isn't worth breaking up the
+            # tuple.
             return positions[key][1]
         return keys.sort(key=get_index_memo)
 

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to