2013/5/3 Andy Bradford:
> Jan Nijtmans on Fri, 03 May 2013 11:21:03 +0200:
>> Any  other ideas?  Should  "fossil clean"  be  undo-able like  "fossil
>> revert", or do  we expect that people setting  "ignore-glob" know what
>> they are doing? ....
>
> I don't think that ``fossil clean''  should be undo-able. It's just more
> code in fossil that is unnecessary.
>
> Just my $.02.

In my (experimental) implementation [8e74f0fe40], I buy your $.02.
The reason: "fossil clean" already asks beforehand if you are sure,
that's already a safety measure. In [8e74f0fe40], even when the user
already answered "y' it still was saved for "undo", which indeed
seems too much. It caused "fossil clean" to take a long time for
taking the snapshots for all small *.o files, that's not really useful.

The amount of additional code is not really an issue: The "undo"
API is already there, it was just adding a few calls to already
existing functions. The biggest problem was what Richard
already mentioned: taking snapshots of potentially many/large
files could easily blow up the ".fslckout"/"_FOSSIL_" database.
That should be addressed before making "fossil clean" undo-able.

I merged the improvement to "trunk" now without additional safety
measures, so "fossil clean" now removes the *.o files and the like
without asking for confirmation. For any file not matching either
"--keep" or "--ignore", it will continue to ask confirmation as before.
If anyone thinks this is insufficient, please let me know!

However, I think it would still be a good idea to make "fossil clean"
undo-able, but only for files <10M and only for files not matching
either "--keep" or "--ignore". That should address Richard's remark.
My current idea would be:

- For files matching "keep-glob", don't ever remove!
- For files matching "ignore-glob", remove them without asking
  for confirmation and don't take a snapshot for "undo"
- For files >10M not matching --keep or --ignore, do as before: prompt
  before deletion and warn that the deletion will not be undoable.
- For files <10M not matching --keep or --ignore, delete them
  (and print it out!), but first take a snapshot in the "undo" table.
- If -f|--force is specified, don't ask for confirmation ever and
  don't make any snapshots for "undo". But "keep-glob" and
  "ignore-glob" should be respected.

I will experiment with this, in order to see if this is practically useful.
Feedback appreciated!

Regards,
        Jan Nijtmans
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to