Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing two CVS revisions in Eclipse

Tags:

eclipse

cvs

It finally started to annoy me enough to ask this question: how do I do a basic diff between two revisions of a file in CVS? Usually I want to compare the latest revision and some random old one. I'm using the Eclipse CVS plugin. When I use "compare with->Another branch or version..." from the selected file's (latest revision from HEAD or another branch) context menu, I get a list of branches, tags and dates but not revisions. Usually I have just created a date which I know is far enough in the past so I can compare the needed revisions but I thought that there must be a better way.

like image 261
auramo Avatar asked Sep 16 '08 12:09

auramo


People also ask

How do I compare two projects in eclipse?

To compare two files, highlight them in a view such as the Package Explorer and select Compare With→ Each Other in the view's context menu.

How does CVS check diff?

For example, if you check out revision 1.6 of Makefile , edit the file, then run cvs diff -r 1.6 Makefile , diff displays the changes you made to Makefile since you checked it out. If you invoke cvs diff with two -r or -D options, CVS compares the two revisions against each other.


2 Answers

The answer is to show the file's history using context menu->Team->Show history, then choose two revisions and context menu for the selection->compare with each other.

like image 167
auramo Avatar answered Nov 01 '22 09:11

auramo


There seems to be two main ways:

context menu->Team->Show history

which shows a linear history and you can select and compare between them, however it can be very bloated and hard to read when your project has lots of branches / tags. Personally i have found it less useful than:

context menu->Team->Show Commit history

Which seems to show the history of what has been committed to the specific branch/tag you are on. You can do it per file or per folder. The output is very similar but i find it clearer. You can click on a commit date and it will show you all the files (that you are interested in) that were committed on that date.

If you double click the file, it will then bring up another menu so that you can compare it with another file in the commit history

EDIT (i find if you double click the "other" file, it doesn't do anything, you need to click "OK" in the dialogue, which seems silly to me. This might be effected by the fact I have the beyond compare 3 plug in, im not sure if it behaves the same without it) EDIT

There is also a little button in the top right of the commit history window that allows you to switch to history view (but i always find it easy to read than the normal history view if i do it this way round)

Both should show you the comment added when committed and you should try and read about the differences between the but personally I haven't and its only form personal experience that i prefer commit history.

I apologize for not giving formal descriptions of each, this is purely from my personal experience of using them, i have not actually researched them both yet myself...

like image 2
chrispepper1989 Avatar answered Nov 01 '22 09:11

chrispepper1989