~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

Tweak warning in commit about isinstance, and merge poolies commit fix for MemoryTree on a CHKInventory repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
77
77
                            )
78
78
from bzrlib.testament import Testament
79
79
from bzrlib.trace import mutter, note, warning, is_quiet
80
 
from bzrlib.inventory import InventoryEntry, make_entry
 
80
from bzrlib.inventory import Inventory, InventoryEntry, make_entry
81
81
from bzrlib import symbol_versioning
82
82
from bzrlib.symbol_versioning import (deprecated_passed,
83
83
        deprecated_function,
698
698
    def _report_and_accumulate_deletes(self):
699
699
        # XXX: Could the list of deleted paths and ids be instead taken from
700
700
        # _populate_from_inventory?
701
 
        deleted_ids = set(self.basis_inv._byid.keys()) - \
702
 
            set(self.builder.new_inventory._byid.keys())
 
701
        if (isinstance(self.basis_inv, Inventory)
 
702
            and isinstance(self.builder.new_inventory, Inventory)):
 
703
            # Performance with commit was profiled extensively, and it found that
 
704
            # using the keys (rather than eg building a set from the dict, or
 
705
            # from the key iterator) of the Inventory._byid was faster at the
 
706
            # time. We want to move away from doing this, but until careful
 
707
            # profiling is done, we're preserving the old behaviour.
 
708
            # <lifeless, poolie>
 
709
            deleted_ids = set(self.basis_inv._byid.keys()) - \
 
710
               set(self.builder.new_inventory._byid.keys())
 
711
        else:
 
712
            deleted_ids = set(self.basis_inv) - set(self.builder.new_inventory)
703
713
        if deleted_ids:
704
714
            self.any_entries_deleted = True
705
715
            deleted = [(self.basis_tree.id2path(file_id), file_id)