633
633
raise BzrError("%r is not present in revision %s" % (file, revno))
634
634
tree.print_file(file_id)
637
def remove(self, files, verbose=False):
638
"""Mark nominated files for removal from the inventory.
640
This does not remove their text. This does not run on
642
TODO: Refuse to remove modified files unless --force is given?
644
TODO: Do something useful with directories.
646
TODO: Should this remove the text or not? Tough call; not
647
removing may be useful and the user can just use use rm, and
648
is the opposite of add. Removing it is consistent with most
649
other tools. Maybe an option.
651
## TODO: Normalize names
652
## TODO: Remove nested loops; better scalability
653
if isinstance(files, basestring):
656
tree = self.working_tree()
659
# do this before any modifications
663
raise BzrError("cannot remove unversioned file %s" % quotefn(f))
664
mutter("remove inventory entry %s {%s}" % (quotefn(f), fid))
666
# having remove it, it must be either ignored or unknown
667
if tree.is_ignored(f):
671
show_status(new_status, inv[fid].kind, quotefn(f))
674
self._write_inventory(inv)
676
636
# FIXME: this doesn't need to be a branch method
677
637
def set_inventory(self, new_inventory_list):
678
638
from bzrlib.inventory import Inventory, InventoryEntry