Comment 2 for bug 323111

Revision history for this message
Martin Pool (mbp) wrote : Re: can not delete directory with ignored files

Some options for handling this:

0- Give a clear message that "directory could not be deleted because it contains unversioned files" and then make sure that just deleting the directory is enough to clear the conflict.

1- Make a trash directory somewhere, and move the to-be-deleted files into there. This could be useful if it's done every time files are to be deleted. It may use a lot of space.

2- Add a rules category of 'junk', which is like a stronger form of 'ignored'. These files are always considered safe to delete automatically, though ignored files are not.

  [name *.pyc]
     junk = true

This perhaps gives the correct behaviour (that these files should never be kept) at the expense of some more user model complexity. It doesn't totally address the bug because people who have first hit this situation may still be confused, but it would complement #0. This could be useful if we then automatically collected junk at various points, like after updating, because it would remove outdated pyc files that sometimes cause trouble.

Things like editor backups and swap files should not be removed so aggressively, but probably shouldn't block directory deletion.