/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: Robert Collins
  • Date: 2007-09-05 05:51:34 UTC
  • mto: (2592.3.126 repository)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070905055134-pwbueao0qq6krf9u
nuke _read_tree_state and snapshot from inventory, moving responsibility into the commit builder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
        self.rev_id = None
228
228
        self.specific_files = specific_files
229
229
        self.allow_pointless = allow_pointless
230
 
        self.recursive = recursive
231
230
        self.revprops = revprops
232
231
        self.message_callback = message_callback
233
232
        self.timestamp = timestamp
296
295
                    entries_title="Directory")
297
296
            self.builder = self.branch.get_commit_builder(self.parents,
298
297
                self.config, timestamp, timezone, committer, revprops, rev_id)
 
298
            # tell the builder about the chosen recursive behaviour
 
299
            self.builder.recursive = recursive
299
300
            
300
301
            try:
301
302
                self._update_builder_with_changes()
665
666
        work_inv = self.work_tree.inventory
666
667
        assert work_inv.root is not None
667
668
        entries = work_inv.iter_entries()
 
669
        # XXX: Note that entries may have the wrong kind.
668
670
        if not self.builder.record_root_entry:
669
671
            entries.next()
670
672
        for path, existing_ie in entries:
683
685
            if is_inside_any(deleted_paths, path):
684
686
                continue
685
687
            if not specific_files or is_inside_any(specific_files, path):
 
688
                # TODO: fix double-stat here.
686
689
                if not self.work_tree.has_filename(path):
687
690
                    deleted_paths.add(path)
688
691
                    self.reporter.missing(path)
689
692
                    deleted_ids.append(file_id)
690
693
                    continue
 
694
            # TODO: have the builder do the nested commit just-in-time IF and
 
695
            # only if needed.
691
696
            try:
692
697
                kind = self.work_tree.kind(file_id)
693
698
                # TODO: specific_files filtering before nested tree processing
694
 
                if kind == 'tree-reference' and self.recursive == 'down':
 
699
                if kind == 'tree-reference' and self.builder.recursive == 'down':
695
700
                    self._commit_nested_tree(file_id, path)
696
701
            except errors.NoSuchFile:
697
702
                pass
700
705
            # Note: I don't particularly want to have the existing_ie
701
706
            # parameter but the test suite currently (28-Jun-07) breaks
702
707
            # without it thanks to a unicode normalisation issue. :-(
703
 
            definitely_changed = kind != existing_ie.kind 
 
708
            definitely_changed = kind != existing_ie.kind
704
709
            self._record_entry(path, file_id, specific_files, kind, name,
705
710
                parent_id, definitely_changed, existing_ie)
706
711
 
722
727
                self.work_tree.branch.repository
723
728
        try:
724
729
            sub_tree.commit(message=None, revprops=self.revprops,
725
 
                recursive=self.recursive,
 
730
                recursive=self.builder.recursive,
726
731
                message_callback=self.message_callback,
727
732
                timestamp=self.timestamp, timezone=self.timezone,
728
733
                committer=self.committer,