71
71
from bzrlib.osutils import (kind_marker, isdir,isfile, is_inside_any,
72
72
is_inside_or_parent_of_any,
73
73
minimum_path_selection,
74
quotefn, sha_file, split_lines)
74
quotefn, sha_file, split_lines,
75
77
from bzrlib.testament import Testament
76
78
from bzrlib.trace import mutter, note, warning, is_quiet
77
79
from bzrlib.xml5 import serializer_v5
717
719
if kind == 'directory':
718
720
self._next_progress_entry()
719
721
# Skip files that have been deleted from the working tree.
720
# The deleted files/directories are also recorded so they
721
# can be explicitly unversioned later. Note that when a
722
# filter of specific files is given, we must only skip/record
723
# deleted files matching that filter.
724
if is_inside_any(deleted_paths, path):
722
# The deleted path ids are also recorded so they can be explicitly
725
path_segments = splitpath(path)
726
deleted_dict = deleted_paths
727
for segment in path_segments:
728
deleted_dict = deleted_dict.get(segment, None)
729
if deleted_dict is None:
730
# We took a path not present in the dict.
733
# We've reached an empty child dir in the dict, so are now
738
if deleted_dict is not None:
739
# the path has a deleted parent, do not add it.
726
741
content_summary = self.work_tree.path_content_summary(path)
742
# Note that when a filter of specific files is given, we must only
743
# skip/record deleted files matching that filter.
727
744
if not specific_files or is_inside_any(specific_files, path):
728
745
if content_summary[0] == 'missing':
729
deleted_paths.add(path)
746
if not deleted_paths:
747
# path won't have been split yet.
748
path_segments = splitpath(path)
749
deleted_dict = deleted_paths
750
for segment in path_segments:
751
deleted_dict = deleted_dict.setdefault(segment, {})
730
752
self.reporter.missing(path)
731
753
deleted_ids.append(file_id)