106
_raise_if_nonexistent(specific_files, old, new)
106
specific_files, nonexistents \
107
= _filter_nonexistent(specific_files, old, new)
107
108
want_unversioned = not versioned
109
110
changes = new.iter_changes(old, show_unchanged, specific_files,
139
140
to_file.write("%s %s\n" % (prefix, conflict))
141
# Show files that were requested but don't exist (and are
142
# not versioned). We don't involve delta in this; these
143
# paths are really the province of just the status
144
# command, since they have more to do with how it was
145
# invoked than with the tree it's operating on.
146
if nonexistents and not short:
147
to_file.write("nonexistent:\n")
148
for nonexistent in nonexistents:
149
# We could calculate prefix outside the loop but, given
150
# how rarely this ought to happen, it's OK and arguably
151
# slightly faster to do it here (ala conflicts above)
156
to_file.write("%s %s\n" % (prefix, nonexistent))
140
157
if (new_is_working_tree and show_pending):
141
158
show_pending_merges(new, to_file, short, verbose=verbose)
163
raise errors.PathsDoNotExist(nonexistents)
254
273
to_file.write(sub_prefix + log_message + '\n')
257
def _raise_if_nonexistent(paths, old_tree, new_tree):
258
"""Complain if paths are not in either inventory or tree.
260
It's OK with the files exist in either tree's inventory, or
261
if they exist in the tree but are not versioned.
276
def _filter_nonexistent(orig_paths, old_tree, new_tree):
277
"""Convert orig_paths to two sorted lists and return them.
279
The first is orig_paths paths minus the items in the second list,
280
and the second list is paths that are not in either inventory or
281
tree (they don't qualify if they exist in the tree's inventory, or
282
if they exist in the tree but are not versioned.)
284
If either of the two lists is empty, return it as an empty list.
263
286
This can be used by operations such as bzr status that can accept
264
287
unknown or ignored files.
266
mutter("check paths: %r", paths)
269
s = old_tree.filter_unversioned_files(paths)
289
mutter("check paths: %r", orig_paths)
291
return orig_paths, []
292
s = old_tree.filter_unversioned_files(orig_paths)
270
293
s = new_tree.filter_unversioned_files(s)
271
s = [path for path in s if not new_tree.has_filename(path)]
273
raise errors.PathsDoNotExist(sorted(s))
294
nonexistent = [path for path in s if not new_tree.has_filename(path)]
295
remaining = [path for path in orig_paths if not path in nonexistent]
296
# Sorting the 'remaining' list doesn't have much effect in
297
# practice, since the various status output sections will sort
298
# their groups individually. But for consistency of this
299
# function's API, it's better to sort both than just 'nonexistent'.
300
return sorted(remaining), sorted(nonexistent)