/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Andrew Bennetts
  • Date: 2008-11-27 06:29:56 UTC
  • mfrom: (3861 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3863.
  • Revision ID: andrew.bennetts@canonical.com-20081127062956-v0a19icwk85iosx4
Merge bzr.dev.

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
60
60
    debug,
61
61
    errors,
62
62
    revision,
 
63
    trace,
63
64
    tree,
64
65
    )
65
66
from bzrlib.branch import Branch
77
78
                            )
78
79
from bzrlib.testament import Testament
79
80
from bzrlib.trace import mutter, note, warning, is_quiet
80
 
from bzrlib.inventory import InventoryEntry, make_entry
 
81
from bzrlib.inventory import Inventory, InventoryEntry, make_entry
81
82
from bzrlib import symbol_versioning
82
83
from bzrlib.symbol_versioning import (deprecated_passed,
83
84
        deprecated_function,
384
385
                # Add revision data to the local branch
385
386
                self.rev_id = self.builder.commit(self.message)
386
387
 
387
 
            except:
 
388
            except Exception, e:
 
389
                mutter("aborting commit write group because of exception:")
 
390
                trace.log_exception_quietly()
 
391
                note("aborting commit write group: %r" % (e,))
388
392
                self.builder.abort()
389
393
                raise
390
394
 
702
706
    def _report_and_accumulate_deletes(self):
703
707
        # XXX: Could the list of deleted paths and ids be instead taken from
704
708
        # _populate_from_inventory?
705
 
        deleted_ids = set(self.basis_inv._byid.keys()) - \
706
 
            set(self.builder.new_inventory._byid.keys())
 
709
        if (isinstance(self.basis_inv, Inventory)
 
710
            and isinstance(self.builder.new_inventory, Inventory)):
 
711
            # the older Inventory classes provide a _byid dict, and building a
 
712
            # set from the keys of this dict is substantially faster than even
 
713
            # getting a set of ids from the inventory
 
714
            #
 
715
            # <lifeless> set(dict) is roughly the same speed as
 
716
            # set(iter(dict)) and both are significantly slower than
 
717
            # set(dict.keys())
 
718
            deleted_ids = set(self.basis_inv._byid.keys()) - \
 
719
               set(self.builder.new_inventory._byid.keys())
 
720
        else:
 
721
            deleted_ids = set(self.basis_inv) - set(self.builder.new_inventory)
707
722
        if deleted_ids:
708
723
            self.any_entries_deleted = True
709
724
            deleted = [(self.basis_tree.id2path(file_id), file_id)