# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kfogel@red-bean.com-20090113175526-j9r5jmjiw5lp6ml5 # target_branch: file:///home/kfogel/src/bzr/bzr-repo/bzr.dev-trunk/ # testament_sha1: ec9abaeb74ca901282e450e22c2e4753f020105f # timestamp: 2009-01-13 12:59:44 -0500 # base_revision_id: kfogel@red-bean.com-20090113175350-\ # ua7s18ga1baf4r7f # # Begin patch === modified file 'bzrlib/status.py' --- bzrlib/status.py 2008-10-01 05:40:45 +0000 +++ bzrlib/status.py 2009-01-08 21:07:56 +0000 @@ -100,7 +100,8 @@ old.lock_read() new.lock_read() try: - _raise_if_nonexistent(specific_files, old, new) + specific_files, nonexistents \ + = filter_nonexistent(specific_files, old, new) want_unversioned = not versioned if short: changes = new.iter_changes(old, show_unchanged, specific_files, @@ -134,6 +135,19 @@ else: prefix = ' ' to_file.write("%s %s\n" % (prefix, conflict)) + # Show files that were requested but don't exist (and are + # not versioned). We don't involve delta in this; these + # paths are really the province of just the status + # command, since they have more to do with how it was + # invoked than with the tree it's operating on. + if nonexistents and not short: + to_file.write("nonexistent:\n") + for nonexistent in nonexistents: + if short: + prefix = 'X ' + else: + prefix = ' ' + to_file.write("%s %s\n" % (prefix, nonexistent)) if (new_is_working_tree and show_pending): show_pending_merges(new, to_file, short) finally: @@ -245,22 +259,24 @@ to_file.write(sub_prefix + log_message + '\n') -def _raise_if_nonexistent(paths, old_tree, new_tree): - """Complain if paths are not in either inventory or tree. - - It's OK with the files exist in either tree's inventory, or - if they exist in the tree but are not versioned. - +def filter_nonexistent(orig_paths, old_tree, new_tree): + """Convert orig_paths to two lists and return them. + + The first is orig_paths paths minus the items in the second list, + and the second list is paths that are not in either inventory or + tree (they don't qualify if they exist in the tree's inventory, or + if they exist in the tree but are not versioned.) + + If either of the two lists is empty, return it as an empty list. + This can be used by operations such as bzr status that can accept unknown or ignored files. """ - mutter("check paths: %r", paths) - if not paths: - return - s = old_tree.filter_unversioned_files(paths) + mutter("check paths: %r", orig_paths) + if not orig_paths: + return orig_paths, [] + s = old_tree.filter_unversioned_files(orig_paths) s = new_tree.filter_unversioned_files(s) - s = [path for path in s if not new_tree.has_filename(path)] - if s: - raise errors.PathsDoNotExist(sorted(s)) - - + nonexistent = [path for path in s if not new_tree.has_filename(path)] + remaining = [path for path in orig_paths if not path in nonexistent] + return remaining, nonexistent # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWdoClvMABI1/gERUQABb9/// Wyoezr////BgCK956H297ivQBm7pGhxNNbbs3b251CSkFM9BGp6gGT9KeJAeozUyAAAaBoOaZGQy YIaMJgjTRoxA0yZGAAIMUNFTxENpkQ0AZNDTIAAAAGmEpopim0TQCaZBPUDJo0AA0DQaaDQIok0m mo0wptNpCnonsjVP0k9IP1RkehqAAfqQRSJoATRk1Mino0p+p6NJ6U/VHqNANGgB6h6mkkjTvM1s OH5dXcGSPPHt3naUlRRHXEOlkz4sXUfjIGwfR5l2rV5bLoh41MEN4QhoYTl6pp1ctCgVhMIA1zsh sT4O84lERv8LADUGZuDocjDu5tXU0tPkOGM3K+yo3TqSQ3X+A21sKzTOpQa063b0SIsN+NkFFOyb tGGUaFFVRrxJty4IitXlBYJw5M/JPdMMMXbcPdTJoBuWeOOo6+NqNYKyo+FbEiwc6n5libJKEYYX GFxfka/9FaSa/OXquD41D0Ha/CHVXpQzaJRfWLrIel7uXTM+XHPB7VXC6QhISFKROJwb1aGJ2xY4 e0WhVXscrFozlqat8otL0WWHHm23YGNuBt2ZSjiW5U7lXiLrfXb7+HXtVvvwverdWBdAMQ/NPAqj vYXr0zZZxUbzPeHLe2ccRPXK3M5tjG96ZqsDHVnUYvP1AUgk5TZDrVmSiQlQFaYgnTlRqSYME+xH dikZDRtNW9oTwhRtpgGRk+Ya6oikz5K682rouTTCZ8MNLVrLY21QCxKoRZ2Q2RP1PWtoFEiFg8ms sWuiHSyQp6EkWyhYQFpXQwL7fWxD2Nv3MkOAXwJlG2LLG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