~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Parth Malwankar
  • Date: 2010-05-28 12:00:30 UTC
  • mto: This revision was merged to the branch mainline in revision 5281.
  • Revision ID: parth.malwankar@gmail.com-20100528120030-bi0e46911uaxu8lr
init no longer iterates files in dir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2291
2291
    for num, _unused in enumerate(wt.all_file_ids()):
2292
2292
        if num > 0:  # more than just a root
2293
2293
            raise errors.WorkingTreeAlreadyPopulated(base=wt.basedir)
2294
 
    existing_files = set()
2295
 
    for dir, files in wt.walkdirs():
2296
 
        existing_files.update(f[0] for f in files)
2297
2294
    file_trans_id = {}
2298
2295
    top_pb = bzrlib.ui.ui_factory.nested_progress_bar()
2299
2296
    pp = ProgressPhase("Build phase", 2, top_pb)
2323
2320
                precomputed_delta = []
2324
2321
            else:
2325
2322
                precomputed_delta = None
2326
 
            for num, (tree_path, entry) in \
2327
 
                enumerate(tree.inventory.iter_entries_by_dir()):
 
2323
            tree_entries = list(enumerate(tree.inventory.iter_entries_by_dir()))
 
2324
            if tree_entries:
 
2325
                existing_files = set()
 
2326
                for dir, files in wt.walkdirs():
 
2327
                    existing_files.update(f[0] for f in files)
 
2328
            for num, (tree_path, entry) in tree_entries:
2328
2329
                pb.update("Building tree", num - len(deferred_contents), total)
2329
2330
                if entry.parent_id is None:
2330
2331
                    continue