This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If you diff a file, change anything in the "local copy" pane and close the diff window The file is SAVED WITHOUT any type of warning or confirmation dialog. That is not the behavior of the normal windows, if you close an edit window with unsaved code you get a confirmation dialog. I would expect the same behavior in the diff window to protect against accidental code changes.
Also, to make things worse, I can't seem to find an 'undo' either. So if you accidentally merge one change to another file, it is automatically saved no matter what you do.
It really bothers me that after 4 months this issue is still "new". Is it only happening to me or can anyone confirm it? Luckily there is the local history because I garbaged lots of files accidentally and only noticed it time after... Should it have a higher priority? Cheers
It's not just you. It happens to everyone, but the feature has been here for more than two years (issue #76681) and no one seems to be unhappy with that. BTW, undo is not enough? Or is undo feature not allowed in your case? I tried with a java file and even after closing the diff i could still undo the changes when i opened the file.
Sorry for not been able to explain myself, I don't have any problem with the feature #76681 (I think it is a good thing) the problem is that, from my point of view, there is an inconsistence in its implementation. In ANY edit window, if your try to close it after you did some changes, it will warn you and ask what you want to do (save the changes, discard them or keep editing) On the contrary, If you change a "diff window" (especially by mistake, e.g. pasting in the wrong position or clicking on one of the "transfer" arrows) those changes are AUTOMATICALLY saved to the local file when you close the window. That is not only different from the other windows in netbeans but from any other "diff" software that I used previously, that will prompt the usual confirmation dialog. Will be it possible to add a confirmation dialog when you close a changed "diff window"? PS: No, undo is not enough because it happened to me that I DIDN'T KNOW that the file was changed and that you needed to "undo" those changes until a few days latter when you try to figure out why some code doesn't work like before
> Will be it possible to add a confirmation dialog when you close a changed "diff window"? I think it will.
Created attachment 88339 [details] patch for Subversion, Mercurial, CVS, ClearCase
I attached a patch for modules Subversion, Mercurial, CVS and ClearCase. The implemented solution needs to be discussed some more (next week) and I will not work on it until we agree on a definite solution. Even if the current solution (implemented by the patch) is accepted, the patch needs some more work, for example extract common code and put it to module versioning.util to make it shared.
Fixed. The UI changes are completely different from those defined by the attached patch. Names of modified files are now rendered bold in the table. The user is not notified about the need to save files until they start the commit procedure or until they close the diff window. If the user is about to commit the modified files, they are asked whether to save unsaved files. All unsaved files from the diff window are listed in the save-dialogue. If the user is about to close the diff window, they are asked whether to save modified files. Files that are opened both in the diff window and in an editor are excluded from the save-dialogue. This change was made for modules Subversion, Mercurial, CVS and Clearcase. Changeset: cdev #6e0249dfbe6e