Issue #2493 resolved

shelve should have confirmation before "delete" action

pasquale dante
created an issue

When select all chunks into thg shelve to revert all changes, thg prompt me a message that say "...revert all changes..?" with yes\no choice. Also if I hit no, all chunks are deleted (and file revert to previous revision)

Here with thg 2.7.1

Comments (10)

  1. Yuya Nishihara

    It asks if you want to revert everything at all because no chunks remain. So,

    • Yes - will restore files completely including their attributes
    • No - will just delete all chunks
  2. 536886

    I think the dialog text needs to be re-worked then. I had one chunk which was selected. This dialog asked if I wanted to revert all chunks. I selected no because I didn't want it to but it did anyway.

    At minimum a cancel option should be provided in case the user in unsure as I was.

    But the text should point out that it is referring to reverting the whole file or the selected chunks but the current text leads you to believe that selecting no will leave the file unaffected which isn't the car.

  3. Yuya Nishihara

    I think the dialog text needs to be re-worked then.

    I'll make a patch if you have a good alternative.

    At minimum a cancel option should be provided in case the user in unsure as I was.

    But you can easily undo it by moving back the chunks.

  4. 536886

    It asks if you want to revert everything at all because no chunks remain. So,

    • Yes - will restore files completely including their attributes

    • No - will just delete all chunks

    I understand a bit more now. Thg has already reverted the selected chunk(s) prior to displaying this dialog. This isn't obvious. As I've clicked a button that can delete code from the working copy, I'd expect a prompt to confirm I actually want to do this. So a dialog prompting

    "Are you sure you wish to delete the selected chunks from the working copy file? Yes | No"

    So that I can cancel the operation if I don't want to do it.

    Then, if the revert will revert all changes, a prompt along the lines of.

    "This will revert all changes in the file. Do you wish to revert all chunks or revert the entire file? Just revert chunks | Revert entire file | Cancel"

    I'd still expect to be able to cancel. Especially because

    But you can easily undo it by moving back the chunks.

    In my case, I'd opened to the shelve tool merely to revert a chunk from a locally modified file while #2606 hasn't been implemented. So I'd not created a shelf, just tried to delete a chunk from a local file. There seems to be no way to revert this as the changes are lost immediately from the working copy and with no shelve to re-apply from, no way to undo it.

    This is why I think the prompts need to be clearer and with a way to cancel prior to the changes being reverted.

  5. Yuya Nishihara

    shelve: add stub to insert confirmation before deleting chunks (refs #2493)

    deleteSelectedChunks is also called by moveChunksRight/Left. New confirmation dialog should be displayed only if a user requests to delete chunks without moving.

    → <<cset 8ab6b7333654>>

  6. Log in to comment