~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Patch Queue Manager
  • Date: 2012-01-27 14:28:32 UTC
  • mfrom: (6445.2.6 avoid-inventory)
  • Revision ID: pqm@pqm.ubuntu.com-20120127142832-qcv2y1c3i0mbt9bl
(jelmer) Avoid the use of inventories in a few more places. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
917
917
            tree = work_tree
918
918
            extra_trees = []
919
919
 
 
920
        self.add_cleanup(tree.lock_read().unlock)
920
921
        if file_list is not None:
921
922
            file_ids = tree.paths2ids(file_list, trees=extra_trees,
922
923
                                      require_versioned=True)
923
924
            # find_ids_across_trees may include some paths that don't
924
925
            # exist in 'tree'.
925
 
            entries = sorted(
926
 
                (tree.id2path(file_id), tree.inventory[file_id])
927
 
                for file_id in file_ids if tree.has_id(file_id))
 
926
            entries = tree.iter_entries_by_dir(specific_file_ids=file_ids)
928
927
        else:
929
 
            entries = tree.inventory.entries()
 
928
            entries = tree.iter_entries_by_dir()
930
929
 
931
 
        self.cleanup_now()
932
 
        for path, entry in entries:
 
930
        for path, entry in sorted(entries):
933
931
            if kind and kind != entry.kind:
934
932
                continue
 
933
            if path == "":
 
934
                continue
935
935
            if show_ids:
936
936
                self.outf.write('%-50s %s\n' % (path, entry.file_id))
937
937
            else:
1009
1009
                and rel_names[0].lower() == rel_names[1].lower()):
1010
1010
                into_existing = False
1011
1011
            else:
1012
 
                inv = tree.inventory
1013
1012
                # 'fix' the case of a potential 'from'
1014
1013
                from_id = tree.path2id(
1015
1014
                            tree.get_canonical_inventory_path(rel_names[0]))
1016
1015
                if (not osutils.lexists(names_list[0]) and
1017
 
                    from_id and inv.get_file_kind(from_id) == "directory"):
 
1016
                    from_id and tree.stored_kind(from_id) == "directory"):
1018
1017
                    into_existing = False
1019
1018
        # move/rename
1020
1019
        if into_existing:
2352
2351
        self.add_cleanup(tree.lock_read().unlock)
2353
2352
        old = tree.basis_tree()
2354
2353
        self.add_cleanup(old.lock_read().unlock)
2355
 
        for path, ie in old.inventory.iter_entries():
 
2354
        for path, ie in old.iter_entries_by_dir():
2356
2355
            if not tree.has_id(ie.file_id):
2357
2356
                self.outf.write(path)
2358
2357
                if show_ids:
2396
2395
        self.add_cleanup(wt.lock_read().unlock)
2397
2396
        basis = wt.basis_tree()
2398
2397
        self.add_cleanup(basis.lock_read().unlock)
2399
 
        basis_inv = basis.inventory
2400
 
        inv = wt.inventory
2401
 
        for file_id in inv:
2402
 
            if basis_inv.has_id(file_id):
2403
 
                continue
2404
 
            if inv.is_root(file_id) and len(basis_inv) == 0:
2405
 
                continue
2406
 
            path = inv.id2path(file_id)
 
2398
        root_id = wt.get_root_id()
 
2399
        for file_id in wt.all_file_ids():
 
2400
            if basis.has_id(file_id):
 
2401
                continue
 
2402
            if root_id == file_id:
 
2403
                continue
 
2404
            path = wt.id2path(file_id)
2407
2405
            if not os.access(osutils.pathjoin(wt.basedir, path), os.F_OK):
2408
2406
                continue
2409
2407
            if null: