~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-06-04 08:54:49 UTC
  • mfrom: (5268.2.8 501307-init-recursive-scan)
  • Revision ID: pqm@pqm.ubuntu.com-20100604085449-n7lw5cj01w94ygxu
(mbp) 'bzr init' does not scan existing directory content anymore. (#501307)
 (Parth Malwankar)

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
 
2323
            # Check if tree inventory has content. If so, we populate
 
2324
            # existing_files with the directory content. If there are no
 
2325
            # entries we skip populating existing_files as its not used.
 
2326
            # This improves performance and unncessary work on large
 
2327
            # directory trees. (#501307)
 
2328
            if total > 0:
 
2329
                existing_files = set()
 
2330
                for dir, files in wt.walkdirs():
 
2331
                    existing_files.update(f[0] for f in files)
2326
2332
            for num, (tree_path, entry) in \
2327
2333
                enumerate(tree.inventory.iter_entries_by_dir()):
2328
2334
                pb.update("Building tree", num - len(deferred_contents), total)