Bug 70639 - missing CVS->Edit
missing CVS->Edit
Status: NEW
Product: versioncontrol
Classification: Unclassified
Component: CVS
5.x
PC Windows XP
: P2 with 9 votes (vote)
: 6.x
Assigned To: Ondrej Vrabec
issues@versioncontrol
: NETFIX
: 11891 40809 (view as bug list)
Depends on:
Blocks: 52137 52138
  Show dependency treegraph
 
Reported: 2005-12-20 14:25 UTC by dmladek
Modified: 2012-07-18 16:50 UTC (History)
8 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
current progress (31.33 KB, patch)
2010-04-12 20:19 UTC, dynamite
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dmladek 2005-12-20 14:25:45 UTC
Hi,

I thought I could switch from NB4.1 to quiete stable and improved NB5.0Beta2
which has a lot of "other" nice features. But seems that VCS (especially CVS)
support goes in opposite direction :-/

CVS noted too much simplification which lacks of many useful features IMHO.
For instance Versioning (as it was designed in prev. version). Current
replacement of Versioning IS NOT Verioning BUT rather REMAKE of VCS Groups
(which in this way it's fine).

Other missing features or just possibility is to execute CVS Edit command.
Which is almost blocking for me.


Our CVS server is configured to give you r/o sources when you checkout/update
them or if you commit them. And thus if I wish to edit them using NB first I
have to make them writtable which was easy in NB41 using CVS->edit command.
But now, I have to find these files in a deep dirstructure and using other tool
convert them to be writtable, which is very but very inconvenient:-(

So I'm doing my work in NB41 for now and hope that NB5 won't have such
deficiencies 'because in general I found there lots of useful featers, but also
Eclips have nice ones (and seems that overtook many of them which made NB, the
NetBeans IDE!, but now it's Eclips which has for instance Perspective and NB get
rid of it:-((( and much better CVS support. Shame it!)
Comment 1 _ pkuzel 2005-12-20 14:38:51 UTC
For 5.0 it's intention. It could be added in next version.

BTW:
  - There are no Java APIs for ro->rw transition.
  - do you use CVS Edit for purpose it was designed for?
Comment 2 dejobfu 2005-12-20 15:11:58 UTC
>For 5.0 it's intention. It could be added in next version.
No, you're kidding :-/ In next version after 5.0? And when it'll be?

>  - There are no Java APIs for ro->rw transition.
maybe, and should I care about it? I didn't care about in neither in NB41.

But for what I care is that when I checkout/commit source it became r/o
OF course I don't use NB for that 'cause it is unrealible for
checkouting/updating large repository of its own size. Also there's no sheduler
for keeping sources just up to date regulary and when you unfortunately do
checkout/update sources from NB you can't edit rest of files in you sources.
So I'm using native cvs client for such work.

>  - do you use CVS Edit for purpose it was designed for?
Well, I don't wanna argue about what cvs->edit was designed for.
I just know that it enable me to start edit r/o checkouted source.


Do you know that using CVS support in NB5.0 doesn't convert now writable source
after commit into r/o?
Comment 3 _ pkuzel 2005-12-20 16:11:10 UTC
I'm serious, the implemented functionality is based on users' poll results and
internal usability study. Rare commands were stripped out.

> Do you know that using CVS support in NB5.0 doesn't convert now writable source
> after commit into r/o?

C/S Updated response's mode line is ignored. There is no pure Java way to change
ro -> rw. If you do all operations from IDE there should not be any problem. In
5.0 file editing is not blocked for long lasting updates.
Comment 4 dmladek 2005-12-20 16:31:15 UTC
>> Do you know that using CVS support in NB5.0 doesn't convert now writable source
> after commit into r/o?
Yap, exactly. 
Probably because of you said at the begining:
"- There are no Java APIs for ro->rw transition."


Sorry, but I'm not sure I understand you.
What is "C/S response mode line"?
And what do you mean by "C/S Updated response's mode line is ignored", please?


>....If you do all operations from IDE there should not be any problem.
but from the reason I listed above it's not possible to do it. 
Only "small" dir hiearchy is suitable to be updated via NB. But not all sources.
That're my experiencies.
Comment 5 _ pkuzel 2005-12-21 11:51:35 UTC
Sorry for the protocole level terminology.

In plain speech it means that NB CVS client never sets the ro file flag.

Comment 6 dmladek 2006-01-03 07:48:28 UTC
Happy New Year 2006!

sorry for longer response, but back to work.


Well, in this case I must say that CVS support in NB ide lack of some important
feature (for me, sure! But I must accept rules settled by cvs admins).
It cannot substitue a native cvs client in this case and as a ide's user I'm
forced to use only NB cvs client and nothing else or stop using the ide.
Non of those possibilities are good (for me:)

Can we try find some solution, please? (in this version, waiting to another
release is like stop using NB).
Comment 7 tkellerer 2006-01-03 21:32:54 UTC
When this gets implemented, it should also automatically check for already
registered editors before actually issuing the CVS edit command
Comment 8 Paul Byrne 2006-02-07 01:15:40 UTC
This is a critical ommision and is causing us and our community a lot of grief.
A number of our community members for Project Looking Glass use cvs watch on
files, this causes the files to be check out read-only.

It is impossible to change these files from the ide. The user either has to use
a shell or another IDE to make the files editable.

This needs resolving ASAP.
Comment 9 _ pkuzel 2006-02-08 13:13:28 UTC
To speedup,
I'm_looking_for_contributors_<http://wiki.java.net/bin/view/Netbeans/VersioningAidTeam>?
Comment 10 Maros Sandor 2006-06-26 13:54:39 UTC
*** Issue 40809 has been marked as a duplicate of this issue. ***
Comment 11 Maros Sandor 2006-12-18 15:42:12 UTC
*** Issue 11891 has been marked as a duplicate of this issue. ***
Comment 12 _ tboudreau 2007-04-03 06:12:59 UTC
It would be trivial to use Runtime.getRuntime().exec ("attrib +R foo.file") or
"chmod u+w foo.file" its unix equivalent.  Given that the old CVS support
invoked external processes for all of it's operations, I can't believe it would
kill performance to do the equivalent for one particular case - a Java API for
doing this would be nice

In the extreme case where the correct command line may not be something we know
how to hardcode (e.g. VMS or OS/2), it's easy enough to pop up a dialog and ask
the user.  That would be a scary dialog, but likely never will be seen except on
non-unix, non-windows platforms, which is close to 0% of users.
Comment 13 _ tboudreau 2007-04-03 06:14:14 UTC
(it helps to finish one's sentences)
a Java API for doing this would be nice but not having one is hardly a showstopper.
Comment 14 _ tboudreau 2007-04-03 06:17:52 UTC
Things to watch for would be:
 - Parsing error output correctly (only a few cases that matter on windows,
probably also true on unix)
    - Correctly identify when the command is unrecognized or chmod program not found
 - Passing Windows shell line length limit (unlikely since "attrib" on windows
doesn't take multiple arguments)
Comment 15 jklousia 2008-04-04 13:28:48 UTC
is this "enhancement" on the todo list? I like NetBeans very much but this is a significant problem. Especially since 
CVS update doesn't warn you when the file its updating is read-only. It simply updates the meta-data without changing 
the contents of the file.
Comment 16 Maros Sandor 2008-04-04 13:47:28 UTC
We do not currently plan active, internal development of CVS here at NetBeans.
Comment 17 dmladek 2008-04-05 20:02:10 UTC
I wouldn't say this is just enhancement.
It's broken functionality from my point of view 'cause it used to work in the past.

regards,
-d
Comment 18 krahe 2008-06-12 14:36:33 UTC
I've looked through the comments and it's not really clear why the CVS Edit/Undo Edit feature had to disappear after NB
4.x, but I've added my vote to this issue.

There was a comment about being able to change a file from ro -> rw purely in Java.  I was amazed, but I did find that
prior to Java SE 6, there was no way to do this.  (You could go the other way with File.setReadOnly().)  However, Java
SE 6 supports File.setWritable() as well, so perhaps this enhancement can be revisited.
Comment 19 dmladek 2008-06-16 22:05:37 UTC
good catch krahe:)
The question is whether the current NB is build and uses jdk 1.6 or not.
Comment 20 Peter Pis 2008-06-16 23:02:04 UTC
Current NB is built on jdk 1.5.
Comment 21 jmccabe 2010-02-23 05:12:27 UTC
I just thought I'd add my support to this. There seems to be everything on the CVS menu that I could possibly want except for the ability to set CVS Edit. We use that quite a lot here and, in the absence of another way for the IDE to be able to set the file's read only status to read write ( as appears to be being discussed here), it sounds like an important feature to reinstate.
Comment 22 Jiri Kovalsky 2010-02-23 05:33:02 UTC
Hello John, are you aware of the "Switch Read/Write File Access" plugin [1]? It is also available on the Update Center for NetBeans 6.8. Just invoke "Tools > Plugins", switch to "Available Plugins" tab and type "Switch" to "Search" field, then check "Install" checkbox and click "Install" button.

[1] http://plugins.netbeans.org/PluginPortal/face/PluginDetailPage.jsp?pluginid=23133

Does this satisfy your need?
Comment 23 jmccabe 2010-02-23 05:41:12 UTC
(In reply to comment #22)
> Hello John, are you aware of the "Switch Read/Write File Access" plugin [1]?

Hi - I hadn't noticed that one, but I've now installed it and will check it out. It sounds like it might help, but obviously it doesn't do the job of CVS Edit from the point of view of letting people who are also editing or watching the file know about it.
Comment 24 jmccabe 2010-02-23 05:42:11 UTC
(In reply to comment #23)
Ooops - forgot to say Thanks!
Comment 25 Jiri Kovalsky 2010-02-23 06:42:37 UTC
Yes, I know what you mean. Unfortunately, this was possible with CVS profile in Generic VCS module a long time ago. At least I added this issue to the pool [1] of NetFIX candidates hoping somebody from NetFIX community developers could implement this. Now let's hope for the best. :-)

[1] http://wiki.netbeans.org/NetFIXIssues
Comment 26 dynamite 2010-03-22 23:46:07 UTC
Whilst there is an EditCommand class in the CVS client library it seems that this includes a CommandRequest.NOOP request.  I'm not currently able to get the cvs edit command to work in NB.

Are we sure that the edit command works in the CVS client library?
Comment 27 Tomas Stupka 2010-03-26 14:07:17 UTC
> Are we sure that the edit command works in the CVS client library?
as already mentioned in a post before - the cvs/edit wasn't meant to be implemented in the first place and afaik the cvs command isn't fit to be used yet. 

one more thing we should mention in this context is that cvs/edit shouldn't be considered as a menu action per se as such would be more or less only a simpleton implementation. 
There are also scenarios when files are to be changed in the IDE but not edited by hand by the user - e.g.:
- refactoring
- project metadata when e.g. adding removing dependencies
- project.properties 

Not only that we should have a mechanism how to handle such cases, a user should also have a way how to fine tune such "edit on demand" behavior - some options like "Automatically (cvs edit files on demand)" "Disable (manual cvs edit required to modify files)", "Prompt for Action", ...

At the time when this issue was filed there was no infrastructure to handle such cases, but that changed since then and we already have an similar implementation in the ClearCase module. So see there for a possible inspiration, especially o.n.m.clearcase.ClearcaseInterceptor.beforeEdit(...), .doMove(...) and deleteFile(...), to learn how to handle IDE file events.
Comment 28 dynamite 2010-04-06 20:46:35 UTC
I'm struggling to get the cvs edit command to work correctly.  I keep getting the error:

cvs [edit aborted]: current directory (<remote>) contains an invalid character (+,>;=\t\n)

I don't however see anywhere where I get to set the current directory.  The command seems to define the local directory correctly.  Any ideas as to where I can look?  Where is the command actually executed?
Comment 29 dynamite 2010-04-10 11:21:59 UTC
I've finally made some progress.  It seems that CvsLiteFileHandler had inverted logic in its setFileReadOnly method.  Once I fix that I can see the Edit/Unedit commands working and so now I can continue with the integration.
Comment 30 dynamite 2010-04-12 20:19:57 UTC
Created attachment 97122 [details]
current progress
Comment 31 dynamite 2010-04-14 21:50:57 UTC
Some notes for whoever wishes to complete the attached patch:

The patch includes Edit and Unedit entries for the CVS menu which allows the user to manually declare whether they are editing a given file.  The menu options are added in org/netbeans/modules/versioning/system/cvss/Annotator.java.  This follows the pattern of other menu actions in that there is an EditAction class which uses an EditExecutor to construct the required EditCommands (from CVS client module).  The executor causes the CVS commands to be performed asynchronously, thus freeing the event thread.

Files affected by automatic IDE actions (e.g. refactoring) also need to have cvs edit declared (as indicated by an earlier comment to this issue).  This is handled by the beforeEdit(File) method in org/netbeans/modules/versioning/system/cvss/FilesystemHandler.java.  beginEdit as currently coded always send cvs edit.  This needs to be made configurable as described by comment #27.

Additionally cvs checkout may need to reflect the configuration of cvs edit usage.  If cvs edit is to be used then files ought to be checked-out as read-only files which will then only become writable once cvs edit is triggered.
Comment 32 Jiri Kovalsky 2012-07-18 16:50:06 UTC
Daniel is no longer working on this issue. Resetting to default assignee.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo