[Pkg-bazaar-commits] ./bzr/unstable r556: - fix up Inventory.entries()

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:19:22 UTC 2009


------------------------------------------------------------
revno: 556
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-05-25 13:54:51 +1000
message:
  - fix up Inventory.entries()
  - make 'inventory' command use entries() for performance testing
modified:
  bzrlib/commands.py
  bzrlib/inventory.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-05-20 02:16:01 +0000
+++ b/bzrlib/commands.py	2005-05-25 03:54:51 +0000
@@ -307,7 +307,7 @@
         else:
             inv = b.get_revision_inventory(b.lookup_revision(revision))
 
-        for path, entry in inv.iter_entries():
+        for path, entry in inv.entries():
             print '%-50s %s' % (entry.file_id, path)
 
 

=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py	2005-05-25 03:48:09 +0000
+++ b/bzrlib/inventory.py	2005-05-25 03:54:51 +0000
@@ -336,17 +336,17 @@
 
         This may be faster than iter_entries.
         """
-        def accum(self, dir_ie, dir_path, a):
-            kids = from_dir.children.items()
+        def accum(dir_ie, dir_path, a):
+            kids = dir_ie.children.items()
             kids.sort()
             for name, ie in kids:
                 child_path = os.path.join(dir_path, name)
                 a.append((child_path, ie))
                 if ie.kind == 'directory':
-                    accum(ie, ie, child_path, a)
+                    accum(ie, child_path, a)
 
         a = []
-        accumt(self, self.root, a)
+        accum(self.root, '', a)
         return a
 
 



More information about the Pkg-bazaar-commits mailing list