This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse and CVS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse and CVS" Watch "Eclipse and CVS" New topic
Author

Eclipse and CVS

Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
My first cvs checkout was before using eclipse, using command line. Now that I've installed eclipse, I managed to map eclipse with my CVS repository. I can navigate through it without problems.
Now, How do I link the code that I downloaded at the beginning with the code in cvs? For example, I wanted to compare 2 files, one in my local pc against the one in CVS, but I've spent hours trying to figure out how to get this "compare" window working, with no success.
If I right-click on a file in my local pc, there's an option that says "compare with", but when I click the right arrow the only option available is "local history"
any ideas, suggestions?


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
I don't use eclipes. Can yuo do cvs diff file.java in command line? Is your cvs depot a local one or remote server that require login?
Also, please verify you can actually access CVS from your eclipes.
Dan Kehn
Dastardly Dan the Author
Ranch Hand

Joined: Jun 11, 2003
Posts: 120
Originally posted by Andres Gonzalez:
If I right-click on a file in my local pc, there's an option that says "compare with", but when I click the right arrow the only option available is "local history"
any ideas, suggestions?

First, try turning on label decorations for CVS (Window > Preferences > Workbench > Label Decorations > CVS). In order to compare with something local to a previous revision in the CVS repository, that "local something" must have been known to CVS first. In other words, the file must have been committed (or checked out) at some point in time. This will be denoted by the "harddrive" decoration and the name of the associated CVS server on the object's label.
If that hasn't been done, then only local comparisons are offered.
-- Dan


Co-author of <a href="http://www.jdg2e.com" target="_blank" rel="nofollow">The Java Developer's Guide to Eclipse</a>, 2nd Edition<br />(Yahoo group <a href="http://groups.yahoo.com/group/JDG2E/" target="_blank" rel="nofollow">JDG2E</a>)
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Right click on the project and do "Team -> Share...". Eclipse will pick up already existing CVS information or ask you for the CVS servers connection parameters. After that, all the CVS functionality is activated for that project.
There should also be an entry with more information about this in the online help, BTW.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Thank you guys
Ilja: Right click on the project and do "Team -> Share...". Eclipse will pick up already existing CVS information or ask you for the CVS servers connection parameters. After that, all the CVS functionality is activated for that project.
I have followed your steps and synchronized my code with the respository. However, after that if I (right click > compare with) on a single java file in my navigator window i get these options:
latest from HEAD (disabled)
another branch or version (disabled)
each other (disabled)
revision (disabled)
local history (enabled)
So now, I can see more options, but sill none of the ones I need are enabled, they're all disabled.
It happens the same if I right click on a any of my java files > team, the only enabled option is "patch", the rest are disabled.
Also, If I right click on my project:
(right click > team >), all the options *are* enable:
Synchronize with repository...
commit..
update...
create patch...
...
why are they enabled in my root project folder but not inside my project (if I click on any file)?
P.S. I've also ticked the CVS decoration option
thanks
[ November 04, 2003: Message edited by: Andres Gonzalez ]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Mhh, that's strange. What do the file decorations look like? What do you see in the CVS section of the properties for that file?
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Originally posted by Ilja Preuss:
Mhh, that's strange. What do the file decorations look like? What do you see in the CVS section of the properties for that file?

Thanks Ilja -
I haven't touched file decorations at all, they should work as-is (i guess). If I right click on a file in my local pc and select properties > cvs, it says:
"this file is ignored by CVS".
great experience using eclipse
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
I did a complete checkout again and it seems to be working, now I can see all the decorators...
thanks
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Andres Gonzalez:
I haven't touched file decorations at all, they should work as-is (i guess). If I right click on a file in my local pc and select properties > cvs, it says:
"this file is ignored by CVS".
great experience using eclipse

I get this message for a file in a folder which is in .cvsignore - perhaps you did that accidentally?
Ram Kumar Subramaniam
Ranch Hand

Joined: Jan 17, 2003
Posts: 68
Try this ..... create a new file. Then right click on the folder in which the file exists .... and choose Team >> syn with rep...... then in the Syn mode view right click on that file ... and choose "Add to Version control"(Dont commit) ......
Then go back to the normal mode and right click and say compare with latest version on CVS ..... and click on the file ..... and see the comparsion ...... There's nothing on the CVS ...... Strange right ..... Dont you think the file should have already been added when u said "Add ti Version Control" ??? It only adds when u commit the file ........
Ram Kumar Subramaniam
Ranch Hand

Joined: Jan 17, 2003
Posts: 68
And again ..... should'nt there be a remove from Version Control option ??? Rather than you having to delete the file on ur system and then sync it. you end up loosing the file when u wanted to just remove the file from version control ....... thoughts to ponder .... (should this be moved to meaningless drive ?? )
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Well, that's just how CVS works. Eclipse can't do much about it, I guess.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse and CVS
 
Similar Threads
Eclipse and CVS
Eclipse cvs setup and check out issues
Eclipse 3.0: CVS Plug-In + RCP client
How to hide some ressources ?
Exclipse and CVS