~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Martin Pool
  • Date: 2005-05-25 03:54:51 UTC
  • Revision ID: mbp@sourcefrog.net-20050525035451-a30c3d0cafb3349a
- fix up Inventory.entries()
- make 'inventory' command use entries() for performance testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
336
336
 
337
337
        This may be faster than iter_entries.
338
338
        """
339
 
        def accum(self, dir_ie, dir_path, a):
340
 
            kids = from_dir.children.items()
 
339
        def accum(dir_ie, dir_path, a):
 
340
            kids = dir_ie.children.items()
341
341
            kids.sort()
342
342
            for name, ie in kids:
343
343
                child_path = os.path.join(dir_path, name)
344
344
                a.append((child_path, ie))
345
345
                if ie.kind == 'directory':
346
 
                    accum(ie, ie, child_path, a)
 
346
                    accum(ie, child_path, a)
347
347
 
348
348
        a = []
349
 
        accumt(self, self.root, a)
 
349
        accum(self.root, '', a)
350
350
        return a
351
351
 
352
352