Is there a way in eclipse to get the compare tool to only show you matching files? - eclipse

I frequently have to diff two trees of source files, one coming from svn (in which you can only check out the whole tree) and the other my eclipse workspace.
99% of the time I only want to see diffs in files that are in both compare trees. The svn side has thousands of files my workspace does not, and I don't need to see them.
Is there a way to get the compare utility to only show files that exist on both sides, and skip the ones it would put the little minus icon on?

One option would be to carefully select only the files and folders you want included in the comparison, then right-click and choose Team > Synchronize with Repository.
That will open the Synchronize perspective and show a Inbound/Outbound view of changes. From there you can "pin" the synchronization and later come back to it and re-sync to see updated results.
You can read some more about the Synchronize view at http://www.eclipse.org/subversive/documentation/teamSupport/workspace_synch.php

Related

When diffing folders, how can I detect moved or renamed files?

I am comparing two folders using a diff tool. I have tried a few different diff tools, but right now I'm using WinMerge. There are many files which show as unique to the right or left side, for example:
On the right we have: /bar/some_organized_characters.txt
On the left we have: /foo/some_similar_organized_characters.txt
The text file may have slight variations, but it's mostly similar. I would expect a tool to exist in most merge/diff tools which could tell you that these files are likely the "same" (meaning they have the same base), but the file has been moved, renamed, and slightly modified.
What I'm specifically trying to do is a "vendor merge." We have some customized software, and we want to merge the changes from a recent official release with the changes we have made. Many files have moved in the latest official release, and finding every move/rename by hand is difficult.
use a version control tool to check for changes. Simply commit the structure as an initial commit. Then overwrite the structure with the new version and commit that. The patch view will show you moved items. I've been able to do this with Git very easily. These tools are made to see how something has changed and will dig into the contents of the file. In fact, in git, you can set the threshold of what percentage of changes in a file constitutes a move and change, vs a delete and create.
I don't think this is possible with diff (I couldn't find it in the manpage).
However git diff detects this by default and can create patches that are applied with git apply in a similar way to patch. You can use it on arbitrary directories, not just repos, with --no-index (see Diffing between two entire directories/projects in hg or git?).

Subclipse / Subversive: Any way to filter out files modified locally

Is there any way using Subclipse or Subversive to apply some kind of filter on Package Explorer that will hide all files that weren't modified locally?
It would be sometimes very useful when I just want focus on my local changes (for example to revise them). I know that files that were modified locally are marked in Package Explorer (in Subclipse by "star" symbol) but in big projects with hundred of files it doesn't help that much (it would be much easier and clearer if only modified files would be visible).
Of course packages containing modified files should be visible as well.
Have you tried the Synchronize view? This shows all your changes in a view which makes it easy to work with the items. You can also create and group items by changeset when using this view.
Using Subclipse, I set the Synchronize view so that all SVN projects in my workspace are synchronized. I then pin it and set a schedule to refresh every hour. Local changes refresh immediately, the hourly schedule is for how often to check the repository for incoming changes.
You can out the view in Outgoing mode if you only want to look at your local changes.

Folders and files not showing in CVS Synchronize with Repository view in Eclipse

Going to the CVS repository perspective and viewing the files shows them, so they checked in just fine, and doing an update will bring them into the project. It is only the synchronize that is having problems.
I have noticed that, when synchronizing trees that do not contain source files such as *.java files causes the cvs synchronize view to look strange (there is an update to be done but it cannot specify the path). Usually, you would actually want to see what is updated..
So, the solution as per me is to perform a team->update on project root level, or to use another cvs client to make the update. (TortoiseCvs works)
I'm not sure if this is the problem, but do you realize files won't appear in the synchronize view if they are identical to the files in the repository?

Different change lists in subclipse?

In IntelliJ, I can have different change lists so that I can put certain files that I never want to commit into a different change list, and I won't be prompted to commit those files unless I select that change list. For example, certain database configuration files, eclipse project files etc., I want to rarely or never commit.
Is there a way to do this using Subversion in Eclipse? I haven't been able to find it so I have to uncheck the files I don't want to commit every time. Note that I can't use svn:ignore because these files are, and should be, in the repository.
You can do this in the Synchronize view. Click the Show Change Sets button. You can then add changed files to change sets (and create new change sets) from the right-click menu.
While the notion of change set of change list is not directly supported by subversion, one possibility would be to use SVN in conjunction with Mylyn.
You could set each group of files to a different task and see if subclipse allows you to commit only one or several tasks through Mylyn.
I have not tested that configuration directly, but it is worth a try.
An option like (see Mylyn Wiki):
Automatically create and manage with task context - Enables automatic change set management. Change sets will be created automatically so that you can commit or update only resources that are in a task's context.
sounds promising.
Change Sets in eclipse (subclipse plugin) does not work too well. If you close the project and reopen it, then either your change sets disappear or all the files you've previously assigned to a change set are now unassigned. SVN:ignore does not work if it happens to be a directory but you want to track files which inside the directory (don't ask how this happens - difficult to explain). IntelliJ change list is much better.
How about putting those files on svn:ignore list?
(set the files to exclude as values of svn:ignore property)
They will be just excluded from versioning so that they never get
commited and any changes to these files will be ignored by subversion.
If you get the TeamCity plugin you can have a more advanced Synchronize view than normal in eclipse.
Or just keep using IDEA......

Comparing two CVS revisions in Eclipse

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.
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.
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...