Inventory.remove_recursive_id should take a list of file-ids
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Inventory.
However, all callers seem to actually have many file-ids to remove (if you remove a directory, it should remove all the children of that directory). When using inv.remove_
The callers currently do:
WorkingTree:
for file_id in file_ids:
if file_id not in self._inventory:
raise errors.
for file_id in file_ids:
if self._inventory
So it first checks that all file ids really do exist, then removes them, checking to avoid removing something that was removed as a side effect.
MemoryTree:
for file_id in file_ids:
if self._inventory
else:
raise errors.
Actually gets it wrong. It does want to check that the ids already exist, and raises an exception if they don't. However, one that used to exist could have gone missing in the meantime.
WorkingTree_4:
if ids_to_unversion:
raise errors.
# have to change the legacy inventory too.
if self._inventory is not None:
for file_id in file_ids:
Also a bit wrong. Did do the check that it has removed all the ids from the dirstate, but then removes everything directly from the inventory.
Note that the source of this bug is probably because commit (without iter_changes) only finds the top-level directory missing. It does not include file-ids for children records. That will be reported on another bug.
tags: | added: api inventory |
tags: | added: check-for-breezy |
tags: | removed: check-for-breezy |