Rev 4773: Cast objects back to tuples for 'dump-btree' in http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple-btree-string-intern

John Arbash Meinel john at arbash-meinel.com
Mon Oct 12 23:09:24 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple-btree-string-intern

------------------------------------------------------------
revno: 4773
revision-id: john at arbash-meinel.com-20091012220919-aybso111vma3deqj
parent: john at arbash-meinel.com-20091012220423-zhf08uf178gwqwog
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-static-tuple-btree-string-intern
timestamp: Mon 2009-10-12 17:09:19 -0500
message:
  Cast objects back to tuples for 'dump-btree'
  This gives a nicer representation in the output.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2009-10-08 16:32:43 +0000
+++ b/bzrlib/builtins.py	2009-10-12 22:09:19 +0000
@@ -431,7 +431,10 @@
         for node in bt.iter_all_entries():
             # Node is made up of:
             # (index, key, value, [references])
-            self.outf.write('%s\n' % (node[1:],))
+            refs_as_tuples = tuple([tuple([tuple(ref) for ref in ref_list])
+                                   for ref_list in node[3]])
+            as_tuple = (tuple(node[1]), node[2], refs_as_tuples)
+            self.outf.write('%s\n' % (as_tuple,))
 
 
 class cmd_remove_tree(Command):



More information about the bazaar-commits mailing list