Bug 76037 - [CVS Add] Add to Source Control should prompt
Summary: [CVS Add] Add to Source Control should prompt
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, helpwanted
Depends on:
Blocks:
 
Reported: 2004-10-11 14:22 EDT by David Biesack CLA
Modified: 2007-08-07 11:01 EDT (History)
3 users (show)

See Also:


Attachments
Confirmation added (3.20 KB, patch)
2007-05-14 07:10 EDT, Krzysztof Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Biesack CLA 2004-10-11 14:22:23 EDT
Due to the (unfortunate?) placement in the Team menu, adjacent to Team->Add to
.cvsignore..., this action (Team->Add to Source Control) can be invoked
accidentally when the intended action was to add to .cvsignore.
This has now happened to me a couple times.

Since Add to Source Control does not have an Undo operation, and since
it does not use a confirmation dialog (thus no way to cancel if you see that
you selected it accidentally), you are left to manually fix this
problem  by manually editing the CVS control files. This can be tricky if you
had several files selected.  

Of course, once you add the file to Version Control (even before committing it),
you can no longer add the file to .cvsignore. This is the double whammy.

Any guidance on how to Undo this operation? I found entries in the CVS/Entries
file that had a "/dummy timestamp". I closed my Eclipse project, edited
CVS/Entries, then opened the project. This appears to work, although I loath
editing CVS metadata files...

In addition to suppporting Undo, I think a UI review of this action (or at least
its placement in the Team menu) is merited.
It is simple enough to do this in Team->Commit if the file has not already
been added to Source Control.  It seems undo-able operations should not be
placed adjacent to operations that have the opposite meaning where they can
be clicked by accident.
Comment 1 Michael Valenta CLA 2004-10-12 15:42:58 EDT
I don't really like the idea of adding a custom command to remove the file 
from version control. I do like the idea of having an Undo but the current CVS 
command infrastructure doesn't support it. If, in the future it does, this is 
one we should consider supporting. We could add an Remove from Version Control 
to the properties dialog as we've done for folders.

Just for your information, I and many pther people don't use Add to Version 
Control at all. Instead, we either ignore resources explicitly or let the 
commit in the synchronize view add them automatically. Both of the later 
actions have prompts which allow the user a chance to ensure that the proper 
operation is taking place on the proper selection.
Comment 2 Jean-Michel Lemieux CLA 2004-10-12 16:06:42 EDT
Michael, it makes sense to be able to undo a mistaken Team > Add/Commit. The
only concern I would have is the placement of such a command (e.g. in the ctx
menu or in the properties page for a file).
Comment 3 David Biesack CLA 2004-10-12 16:17:44 EDT
I agree with your comments; I too normally just add to version control only
during a commit. Perhaps this command can be removed from this menu (Hmm, can a
custom plugin remove things from menus? not sure...) since it does not have much
(if any) utility, or add a confirmation, so that it is hard to execute it (to
completion) accidentally.
Comment 4 Michael Valenta CLA 2004-10-12 16:21:11 EDT
Regarding comment #2, I think using the Undo command makes the most sense 
since that is what your doing. If this is not possible, then my second choice 
would be a button on the properties dialog for a file. We can detect the case 
where the selected file is added but not committed. Also, we should probably 
prompt on Add to Version Control since it is an infrequent operation (as 
suggested in comment #3).
Comment 5 Krzysztof Daniel CLA 2007-05-14 07:10:48 EDT
Created attachment 67036 [details]
Confirmation added

And maybe it is possible to made 'Add to .cvsignore' action mirror reflection of 'Add to Version Control'?

I mean ignoring could be enabled even for shared resources, and ask message like 'You have choosen explicity to ignore shared resource. Do you want to continue, remove it from Version Control and ignore it?'

In this case we do not add new action, ignoring and adding to CVS allows have opposite effects.

Disadvantage of this solution is fact, that resource cannot be simply unshared. But I do not see any purpose of having unshared resource - in the end it should be or shared or ignored.
Comment 6 Michael Valenta CLA 2007-05-16 10:02:14 EDT
This is not critical for 3.3. We can investigate possible solutions in 3.4.
Comment 7 Michael Valenta CLA 2007-06-21 12:05:59 EDT
Patch released to HEAD
Comment 8 Tomasz Zarna CLA 2007-08-07 06:55:12 EDT
Verified in I20070806-1800. The prompting dialog pops up when when needed and works as expected. On the other hand, it looks like the "undo" feature still remains questionable. Do you think we should open a separate bug for it?
Comment 9 Michael Valenta CLA 2007-08-07 10:36:17 EDT
I would prefer not to add an addition context menu item for an action that would rarely (if ever) be used). I think we should wait and see if the confirmation dialog is enough to solve the problem. If it is not adequate, we can revisit the issue.