/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

Commit synthesizes a content_summary without using path_content_summary

Show diffs side-by-side

added added

removed removed

Lines of Context:
801
801
                # Skip excluded paths. Excluded paths are processed by
802
802
                # _update_builder_with_changes.
803
803
                continue
804
 
            content_summary = self.work_tree.path_content_summary(path)
 
804
            kind, executable = self.work_tree.get_kind_and_executable_by_path(
 
805
                path)
805
806
            # Note that when a filter of specific files is given, we must only
806
807
            # skip/record deleted files matching that filter.
807
808
            if not specific_files or is_inside_any(specific_files, path):
808
 
                if content_summary[0] == 'missing':
 
809
                if kind == 'missing':
809
810
                    if not deleted_paths:
810
811
                        # path won't have been split yet.
811
812
                        path_segments = splitpath(path)
816
817
                    self._next_progress_entry()
817
818
                    deleted_ids.append(file_id)
818
819
                    continue
819
 
            # TODO: have the builder do the nested commit just-in-time IF and
820
 
            # only if needed.
821
 
            if content_summary[0] == 'tree-reference':
 
820
            # We don't want to use a contents_summary anymore, but it's still
 
821
            # part of the contract of record_entry_contents, so we fake one
 
822
            # with the right form: (kind, length, exec,
 
823
            # sha_or_link_target_or_tree_revid)
 
824
            if kind == 'symlink':
 
825
                content_summary = (kind, None, None,
 
826
                    self.work_tree.get_symlink_target(file_id))
 
827
            # TODO: specific_files filtering before nested tree processing
 
828
            elif kind == 'tree-reference':
 
829
                # TODO: have the builder do the nested commit just-in-time IF and
 
830
                # only if needed.
822
831
                # enforce repository nested tree policy.
823
832
                if (not self.work_tree.supports_tree_reference() or
824
833
                    # repository does not support it either.
825
834
                    not self.branch.repository._format.supports_tree_reference):
826
 
                    content_summary = ('directory',) + content_summary[1:]
827
 
            kind = content_summary[0]
828
 
            # TODO: specific_files filtering before nested tree processing
829
 
            if kind == 'tree-reference':
830
 
                if self.recursive == 'down':
 
835
                    kind = 'directory'
 
836
                    content_summary = ('directory', None, None, None)
 
837
                elif self.recursive == 'down':
831
838
                    nested_revision_id = self._commit_nested_tree(
832
839
                        file_id, path)
833
 
                    content_summary = content_summary[:3] + (
834
 
                        nested_revision_id,)
 
840
                    content_summary = (kind, None, None, nested_revision_id)
835
841
                else:
836
 
                    content_summary = content_summary[:3] + (
837
 
                        self.work_tree.get_reference_revision(file_id),)
 
842
                    nested_revision_id = self.work_tree.get_reference_revision(file_id)
 
843
                    content_summary = (kind, None, None, nested_revision_id)
 
844
            elif kind == 'file':
 
845
                content_summary = (kind, None, executable, None)
 
846
            else:
 
847
                content_summary = (kind, None, None, None)
838
848
 
839
849
            # Record an entry for this item
840
850
            # Note: I don't particularly want to have the existing_ie