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.

Bug 11764 - UndoEdit doesn't work when Edit was not called before - a warning should be shown
Summary: UndoEdit doesn't work when Edit was not called before - a warning should be s...
Status: VERIFIED WONTFIX
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscvs (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-26 01:22 UTC by Peter Luttrell
Modified: 2002-01-23 09:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log (851.01 KB, text/plain)
2001-07-20 20:36 UTC, Peter Luttrell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Luttrell 2001-04-26 01:22:42 UTC
Using the external cvs client, if you modify a file and then choose 
CVS>Edit>UndoEdit, it does not allways (or very often) revert the file changes.
Comment 1 Peter Luttrell 2001-04-26 01:23:32 UTC
Created attachment 1256 [details]
log
Comment 2 Jan Zajicek 2001-04-26 09:44:50 UTC
Moving to the cvs.
Comment 3 Martin Entlicher 2001-04-26 11:20:35 UTC
We were not able to reproduce it here.
Are you sure, that you call CVS->Edit before you start to edit the file ?
You should use it when the checked out file is read-only. Then an automatic Edit
command is executed when you try to modify the file and later you can revert
your changes by CVS->Undo Edit. But if you didn't run Edit before your
modifications, you can not expect it to work.
Comment 4 Peter Luttrell 2001-04-26 18:47:19 UTC
I can still reproduce it almost every time.
I am not ever doing CVS->Edit before hand.
I don't have any read-only files.

I guess my bug should be changed to the automatic cvs edit command is not being 
executed or failing.

If this is how it is going to be then, my issue is that if you do an Undo Edit 
when you cannot, they netbeans shouldn't prompt you indicating that the file 
has been reverted (when it has not!).
Comment 5 Martin Entlicher 2001-04-26 19:20:58 UTC
Sorry, but have to lower the priority of the issue, because of the bad usage of
the command.
CVS->Undo Edit works only in conjunction with CVS->Edit.
If you don't run CVS->Edit, you can not expect CVS->Undo Edit to work.
The CVS module does nothing more, than executes the appropriate CVS commands in
this case. The automatic Edit command is executed only on read-only files.

However you are right, that the module should not tell you, that the file was
successfully reverted when it's not true. I will try to solve this
inconsistency.
Comment 6 Peter Luttrell 2001-04-26 20:22:27 UTC
Why is the automatic edit command only executed on read-only files?

Also if undo edit is going to have this somewhat hidden requirement that you 
must use it in conjunction with edit, then you should at least put a warning 
message up saying such. Without this (or automatic edit working for all files), 
the undo edit command is quite misleading.
Comment 7 Martin Entlicher 2001-04-26 21:51:29 UTC
> Why is the automatic edit command only executed on read-only files?

Please read http://www.gnu.org/manual/cvs-1.9/html_chapter/cvs_7.html#SEC46

Execution only on read-only files also ensures, that it's not executed multiple
times on every attempt to modify the file.
Comment 8 Peter Luttrell 2001-04-26 23:58:46 UTC
In the cvs manual, i don't see why you would only automaticly call edit only on 
readonly files. It looks to me like it can happen on read/write files too.

>Execution only on read-only files also ensures, that it's not executed multiple
 times on every attempt to modify the file.

There's got to be a better way to handle this. Isn't there a cvsfile class or 
something - just add a flag.
Comment 9 Martin Entlicher 2001-05-11 16:12:43 UTC
> In the cvs manual, i don't see why you would only automaticly call edit only
> on readonly files. It looks to me like it can happen on read/write files too.

Yes, but it's usually used in conjuction with read-only files, otherwise you can
easily forget to run Edit before editing. I would not expect, that anyone would
run Edit on r/w file, but if s/he wants, s/he can run Edit manually via
CVS->Edit.

As for Unedit, I can add a warning that the file is not edited (I mean cvs edit
was not called on it). Is this O.K. for you ?
Comment 10 Peter Luttrell 2001-05-11 17:10:36 UTC
Could the message, allow the user to run the edit at that point?, and then the 
undo edit? Will that even work?

So. User has r/w file. Choose EditUndo. Netbeans prompt saying that the user 
has not called undo edit and asks if the user wants to call it now, or cancel. 
If cancel, undoedit would cancel. If yes, netbeans calls cvs edit, and then 
undo edit, which would then cause the file to be reverted to previous commited.

I'm not sure that this will even work with cvs. If it will not, then i guess a 
simple warning message will have to do. 
Comment 11 Martin Entlicher 2001-05-11 17:46:13 UTC
Well, 'cvs unedit' reconstruct the file to the state when 'cvs edit' was called.
Therefore calling 'cvs edit' right before 'cvs unedit' has no sense.
All I can do at this point is to pop up a simple message saying, that there is
nothing to unedit, since the Edit command was not performed on this file.
Comment 12 Peter Luttrell 2001-05-11 18:59:28 UTC
ok
Comment 13 Martin Entlicher 2002-01-22 09:20:17 UTC
Resolved as wontfix. This bug is fixed in vcsgeneric module (issue
#14901), which is used instead of vcscvs in NetBeans and Forte4Java
builds. vcscvs module is not a part of builds any more.
Comment 14 dmladek 2002-01-23 09:58:53 UTC
OK