~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
from bzrlib.testament import Testament
87
87
from bzrlib.trace import mutter, note, warning
88
88
from bzrlib.xml5 import serializer_v5
89
 
from bzrlib.inventory import Inventory, ROOT_ID, InventoryEntry
 
89
from bzrlib.inventory import Inventory, InventoryEntry
90
90
from bzrlib import symbol_versioning
91
91
from bzrlib.symbol_versioning import (deprecated_passed,
92
92
        deprecated_function,
126
126
    def snapshot_change(self, change, path):
127
127
        if change == 'unchanged':
128
128
            return
 
129
        if change == 'added' and path == '':
 
130
            return
129
131
        note("%s %s", change, path)
130
132
 
131
133
    def completed(self, revno, rev_id):
390
392
        # A merge with no effect on files
391
393
        if len(self.parents) > 1:
392
394
            return
 
395
        # work around the fact that a newly-initted tree does differ from its
 
396
        # basis
 
397
        if len(self.basis_inv) == 0 and len(self.builder.new_inventory) == 1:
 
398
            raise PointlessCommit()
393
399
        # Shortcut, if the number of entries changes, then we obviously have
394
400
        # a change
395
401
        if len(self.builder.new_inventory) != len(self.basis_inv):
550
556
        # in bugs like #46635.  Any reason not to use/enhance Tree.changes_from?
551
557
        # ADHB 11-07-2006
552
558
        mutter("Selecting files for commit with filter %s", self.specific_files)
 
559
        assert self.work_inv.root is not None
553
560
        entries = self.work_inv.iter_entries()
554
561
        if not self.builder.record_root_entry:
555
562
            symbol_versioning.warn('CommitBuilders should support recording'
574
581
                else:
575
582
                    # this entry is new and not being committed
576
583
                    continue
577
 
 
578
584
            self.builder.record_entry_contents(ie, self.parent_invs, 
579
585
                path, self.work_tree)
580
586
            # describe the nature of the change that has occurred relative to