/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-06 01:09:06 UTC
  • mto: (2592.3.129 repository)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070906010906-2so4bg4lr3y8wlqd
Move content summary generation outside of record_entry_contents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
713
713
                    continue
714
714
            # TODO: have the builder do the nested commit just-in-time IF and
715
715
            # only if needed.
716
 
            try:
717
 
                kind = self.work_tree.kind(file_id)
718
 
                # TODO: specific_files filtering before nested tree processing
719
 
                if kind == 'tree-reference' and self.builder.recursive == 'down':
720
 
                    self._commit_nested_tree(file_id, path)
721
 
            except errors.NoSuchFile:
722
 
                pass
 
716
            content_summary = self.work_tree.path_content_summary(path)
 
717
            if content_summary[0] == 'tree-reference':
 
718
                # enforce repository nested tree policy.
 
719
                if (not self.work_tree.supports_tree_reference() or
 
720
                    # repository does not support it either.
 
721
                    not self.branch.repository._format.supports_tree_reference()):
 
722
                    content_summary = ('directory',) + content_summary[1:]
 
723
            kind = content_summary[0]
 
724
            # TODO: specific_files filtering before nested tree processing
 
725
            if kind == 'tree-reference' and self.builder.recursive == 'down':
 
726
                self._commit_nested_tree(file_id, path)
723
727
 
724
728
            # Record an entry for this item
725
729
            # Note: I don't particularly want to have the existing_ie
727
731
            # without it thanks to a unicode normalisation issue. :-(
728
732
            definitely_changed = kind != existing_ie.kind
729
733
            self._record_entry(path, file_id, specific_files, kind, name,
730
 
                parent_id, definitely_changed, existing_ie)
 
734
                parent_id, definitely_changed, existing_ie, content_summary)
731
735
 
732
736
        # Unversion IDs that were found to be deleted
733
737
        self.work_tree.unversion(deleted_ids)
758
762
            pass
759
763
 
760
764
    def _record_entry(self, path, file_id, specific_files, kind, name,
761
 
                      parent_id, definitely_changed, existing_ie=None):
 
765
        parent_id, definitely_changed, existing_ie, content_summary):
762
766
        "Record the new inventory entry for a path if any."
763
767
        # mutter('check %s {%s}', path, file_id)
764
768
        if (not specific_files or 
777
781
                # this entry is new and not being committed
778
782
                ie = None
779
783
        if ie is not None:
780
 
            self.builder.record_entry_contents(ie, self.parent_invs, 
781
 
                path, self.work_tree)
 
784
            self.builder.record_entry_contents(ie, self.parent_invs,
 
785
                path, self.work_tree, content_summary)
782
786
            self._report_change(ie, path)
783
787
        return ie
784
788