Jump to content


Unnecessary dialog on revert


  • Please log in to reply
3 replies to this topic

#1 Zeblote

Zeblote

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 12 June 2018 - 10:33 PM

Talking about this one:

Posted Image

What exactly is the purpose of this dialog? Why does it show up if I'm not reverting a file that is "open for add", only to ask me if I want to delete no files since none of them are "open for add"?

#2 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 267 posts

Posted 13 June 2018 - 12:30 AM

The dialog box lets you know that if you did have files open for add, you would have had a chance to delete them.  Just to let you know that this would have been available.

#3 Zeblote

Zeblote

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 13 June 2018 - 06:56 PM

I see. Is the checkbox meant to save? Currently I have to check it every single time I want to do that.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 588 posts

Posted 13 June 2018 - 07:12 PM

It looks like part of the idea is also that it's a confirmation dialog to make sure you don't irrevocably blast your local changes with one mouse click, and give you a preview of what you'll be blasting.  I don't remember ever seeing this dialog in P4V so I assume it's new, but P4Win had a nice feature where if you did a revert it'd do a "p4 revert -an" first and put up a small confirmation dialog warning you that you were blasting local changes if you had any (if you didn't it'd just silently do the "revert -a").  This seems like it's meant to accomplish the same thing.

The handling of the "-w" option in that dialog is silly, for the following reasons:
  • As Ze noted, it's shown when it's not relevant (i.e. no files opened for add), which is confusing.
  • The "this option cannot be undone" warning is so confusing it deserves sub-bullets:
    • Saying the option can't be undone implies that the option itself is set-once.  What's meant here (I assume) is that the action can't be undone.
    • Reverts as a general rule can't be undone.  Putting a warning in bold on this particular behavior implies that it's unique in that regard -- the same warning would in fact be applicable to the "will discard changes" up at the top.
  • Having this option available at all in this context is of somewhat questionable utility.  The main use of "revert -w" was supposed to be implementing "git stash" style scripts (e.g. "shelve" followed by "revert -w").  Is there a common user workflow where having this checkbox would be useful?  (If not, a user could very easily get by with the default revert behavior coupled with the "clean" command to get rid of abandoned files.)
  • There's no explanation of what happens to added files by default (they're abandoned, i.e. left in an "untracked" state in the workspace).  There are a number of better ways to surface this -- the "-w" flag could be a radio button (abandon new files vs delete new files), or by having it associated with the listview that shows the files (have the listview display what will happen to each file, and swap it from "abandon" to "delete" as you twiddle the option -- this would also be useful for surfacing the difference between "new" files that are open for add and files which are actually some type of "branch" action variant).
Also, why is that list view titled "undo changes made to the following lines" when the items listed are files?  "Lines" would make sense if this were a diff view showing the actual lines of code you're about to lose forever (which would be cool but it doesn't look like that's what we've got here).

Also also, why is the default width of the checkbox column in that listview 6x the width of the checkbox while there's not enough room to show the whole file path?

Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users