Beyond Compare as default diff tool in Eclipse when using Mercurial? - eclipse

Is there any way to make Beyond Compare 3 the default diff tool in Eclipse?
I'm using the Mercurial plugin and would like to use BC3 for diffing files and handling merge conflicts.
I'm only able to find solutions when it comes to CVS or SVN when searching this site.

See the following query for discussion on external diff tool for Mercurial Eclipse.
http://bitbucket.org/mercurialeclipse/main/issue/310/external-diff-tool
It suggests that standard approach for setting up external diff tool should suffice. So setting up ".hgrc" should work.
Since this is no different from any other setup, you can test it by using hg commands in shell. See if that throws any errors and then check out with eclipse.
The setting for external merge tool is available in the plugin settings.
http://bitbucket.org/mercurialeclipse/main/wiki/Installation_and_Configuration#main-preferences
[edit: with hgrc]
This will work when you use command line.
The following "ExtdiffExtension" extension should help.
The extdiff Mercurial extension allows you to use external programs to compare revisions, or revision with working dir. The external diff programs are called with a configurable set of options and two non-option arguments: paths to directories containing snapshots of files to compare.

You need to install Beyond Compare Eclipse Plugin (Beyond CVS) which would provide this functionality.
Cheers!!!

Related

Automatically fill changelog.txt after each SVN commit in any IDE

After trying to search for some information about "Dynamic change of changelog.txt file with IDE", i found nothing that could help me to find the answer.
Imagine that I've made some changes in numerous files (PHP Environment) using Eclipse PHP or JetBrains PHPStorm 3+, and i want to commit them into svn repository. Is it possible to configure any of these IDEs to dynamically fill changelog.txt file in predefined format with informations (Date, SVN Comment, etc...) ?
Thanks in advance for any info which will point to the answer.
Not aware of any plugins that do this automatically, but you could write a script using command-line svn tools (svn utilities are installed by default on Linux; on Windows you can use CollabNet SVN or similar). You can pull the svn logs and redirect to changelog.txt in a format you desire.
You can also do this in python using pysvn module.

How to use external diff viewers in eclipse? Is there any diff viewer available for eclipse inbuilt?

I am working on a java project in eclipse . Every time commit a file i want to view what are all the changes have done in this file . In eclipse its hard to analyze which lines are removed , added , changed etc . Please give your suggestions on this .
You don't say what version control system you're using, but most of them (cvs, svn, git, and perforce, that I know of) implement the Team > Synchronize functionality. The Synchronize perspective provides a preview of both outgoing and incoming changes; you can easily see what has changed that you need to commit side-by-side with what has changed in the repository that you have yet to receive. Right-click a project (or any other selection of version-controlled resources) and select Team > Synchronize. It's virtually identical to what you show from Netbeans.
You can also use the Compare With menu and/or whatever options are presented by your version control system under the Team menu for individual files.
The colors in the compare view can be customized to your liking, via Preferences > General > Appearance > Colors and Fonts (look for Text Compare in the tree).
For Mercurial, the MercurialEclipse plugin implements this Synchronize view.
I landed here because I was looking for a way to merge in an external merge editor (KDIFF3) but start the merge from eclipse. I wasn't satisfied with the answers provided above. So here is ho to configure kdiff3 as merge and diff editor for SVN in eclipse:
go to Windows -> Preferences → Team -> SVN -> Diff Viewer
Add a new config (add button):
Extension or mimetype: * - if you wish you can specify different mimetypes for different editors, I didn't need that thus the alquantor.
Diff: Program path C:\Program Files\KDiff3\kdiff3.exe (or wherever you have your merge editor - sry for the windows path, feel free to add a linux version in the comments or edit this answer.)
Arguments:
${base} ${mine} ${theirs}
Merge: Program path C:\Program Files\KDiff3\kdiff3.exe
Arguments:
${base} ${mine} ${theirs} -o ${merged}
This will probably work as well for other merge editors, but with a different argument syntax (figure it out an let us know :) ).
The usage is as usual (team->edit conflicts) for merging and compare->foo for the diff view.
Cheers
actually eclipse have inbuilt compare tool. if u need compare with any other app, try this plugin
http://sourceforge.net/projects/externaldiff/
Also, if someone doesn't have to call it indirectly from Eclipse (for example I just don't like to install additional packages such as externaldiff from Mohamed Jameel answer on my Linuxes), you may try call external diff viewer from SVN.
On Linux this article was very helpful for me: SVN: how to compare working copy with repository revision?.

Diff directories with content in Netbeans

I duplicated some folder with project's config to a new project a few days ago and made there some modifications (project name, paths, etc).
After few days a source config dir has changed and I am wondering how to diff that folders in 2 projects to apply that changes in new project.
If I select source file and then new file and select diff option in Netbeans - it works. But is it possible to make in on whole folder ?
I was looking for folder compare in NetBeans too. I found http://kenai.com/projects/netbeans-dircomp/downloads. I'll try that in a little while...
NetBeans does not have that feature.
You could probably hack together a shell script that would do this, based on find, etc. This search for 'diff a directory tree' looks like it has some good answer.
I would recommend that you put your source code under some sort of source code control system like CVS, SVN or Mercurial.
You could use those tools to generate a diff of the original project's config between the date you made the copy and 'now'... and then apply that diff onto the copy of the project...
Or, you could apply some of the strategies described in CVS manual for handling third party sources. I think the same concepts are available for svn and mercurial.
A very old question, but Netbeans does have a CVS feature now.
Go to Tools>Plugins and find CVS and install.
After that it is very easy to right click a directory, go to tools, then apply diff patch. That will patch all files in the diff file in that directory. Simple and smooth.
And You Can Also Use The
Total Commander
to Compare the folder and all type off your files
Its amazing in this situation

How do you do merges using Git, Eclipse and Egit

I, like many others, love Eclipse as my ide of choice, and because of the way I work (moving about, different places, different projects) want to use Git for CVS.
There is a plugin for Git in Eclipse, Egit, which is now an official Eclipse project, and currently at version 0.7.1. As I've just started using it I'm interested in how others are using it, and what work arounds they are using. Currently Egit doesn't have support for merges, so these have to be done outside of Eclipse and then the workspace refreshed.
So, How do you do this task ? (and any other tasks that Egit doesn't do right now)
Just for reference, EGIT does now support merges and uses the powerful diff interface within eclipse.
Once you have fetched the code and run a merge, if there are any conflicts they are highlighted in the project explorer with a red !, you can then right click on them and go to Team > Merge Tool, which is un-ghosted for conflicted files.
Once you have selected the code you wish to use (Either the workspace version with diff annotations in it or the HEAD version that caused the conflict) the diff window will open.
This shows your local code on the left and the conflicting code on the right, you can use the 'next difference' button to jump through all the conflicts, and the 'copy change from right to left' button to accept the remote version, or simply edit your local version in place.
Once you are happy with the changes save your file and add it, then commit the results and you should be done.
Please note I am in no way a master of git good practice, so please feel free to correct me if these are not the best operations to use, but it was an answer to the question "How do I do merges in eclipse with egit".
When working with Eclipse, I only use egit to actually commit. Everything else I do simply via the command line. The command line in git (or any other VCS) is much more superior and the software was actually created with having the command line in mind, so it's just naturally that you can access really every single feature via the command line.
Everything else only uses the command line in the background and tries to emulate a different interface, native to the host application (here: Eclipse). But by doing that you can never reach the same power as by using the original tools.
However I think when egit develops more, it might be a good way to work with git; similar to how the subversion plugin for Eclipse works well with most functions. But in my situation, I don't use Eclipse for everything and using the command line is then a lot simpler than trying to get used to multiple different plugins and the command line.
One way to work out with Egit merge conflict is to take backup of your file, delete it from eclipse, put it back from backup, Add to index and commit.
This should be done only if you can't resolve the conflict with normal Add to Index->Commit method.
PS: I assume you've already resolved the conflict manually or by using Egit merge tool, but just can't remove the conflict marker on the file.

svn command line from eclipse

Hello is there a way to use svn command line from eclipse?
Within eclipse in my project browser i can righclick and then click team and than i have something like svn. Not sure which plugin it is. But it doesn't have button's to for example ignore files for uploading. That's why I want to to it command line. And my question is how to do it.
Ok so how can I use it from command line in windows xp?
The plugin you are probably using is Subclipse. It should have an "Add to svn:ignore" option. If not, try updating to the latest versions of Eclipse and Subclipse. In general subclipse should be enough and there is no need for the command line.
For Windows XP I recommend Tortoise SVN. It integrates with the Windows Explorer and offers you a graphical environment for all your needs. I would say that is much more stable than subclipse and very easy to use.
If you do want to use the command line tools, download and install svn-win32 from here. The command line tools could be helpful in merge and copy operations.
I should also point out that none of these methods interfere with each other. You can work with Tortoise SVN or the command line and subclipse won't be affected. All svn clients work by writing and reading from hidden directories called .svn. There is one such directory in every folder under source control. As long as the svn client software is of the same version, an svn client can write to these hidden folders and another one will be able to read from it. A problem could arise if one of the clients is updated to a version that uses a different protocol for writing to the .svn folders. In that case, older clients won't be able to read the information stored there. Upgrading them to the latest version will solve the problem.
Not sure what you're trying to do; sometimes it's better to describe the goal rather than the means you plan to do it.
Have you tried Subeclipse? It lets you use SVN inside Eclipse; it's great.
I'm not sure if you can use it from Eclipse, but nothing stops you from just using it. From cmd / xterm / whatever. It's not going to interfere with Eclipse in anyway, nor will it interfere with Subclipse (which I'm assuming is what you're using).
I'm using subclipse, and in generaly it works pretty well.
However, and I guess this is your problem, the Team Synchronization by default wants to add all files in my projects, not just the ones I add to version control. This is lame and frustrating, and apparently there's no way to turn it off. Screenshots for older versions, however, hints at the possibility of turning the "feature" off. Frustrating!
I'm not personally a fan of Subclipse - it slows the IDE a bit too much for my taste. Here is an alternative approach using External Tools and TortoiseSVN
Create a new External Tool
Call it SVN Commit
Set the Location to \bin\TortoiseProc.exe (mine is C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe)
Set the arguments to /command:commit /path:"${selected_resource_loc}"
Open the file / directory you want committed and run the external tool.
Interchange the commit in step four for additional commands. You can also add the specific tools to favorites and have them in a dropdown on the toolbar.
Additional Arguments Here
Not intended to be too presumptuous here, but I think you should look at whether Subversive or Subclipse actually solves problem in a different way than you intended. For instance, it is very much possible to ignore files and directories from being checked in, via Subclipse.
On the other hand, if you really want to hack away via the command prompt from Eclipse, you must install the Target Management project (supported for Eclipse Europa and Ganymede). Once you have that installed, you can launch a remote shell to your local machine and then type away on the command line :).
PS: I haven't used this approach ever; Subversive satisfied all my requirements of a SVN plugin in Eclipse.