Anyway to get MercurialEclipse to behave like the NetBeans Mercurial support?
Asked Answered
C

2

11

I have installed the MercurialEclipse plugin. I am finding it very hard to use.

I have been using the Mercurial support in NetBeans for a while now, there are many things I would like to be able to do in Eclipse if possible:

  • In NetBeans any changes to source code are highlighted in the line number area. New code is green, modified code is blue, and removed code is red.

  • Files in the project explorer appear as blue or green for modified and new respectively.

enter image description here

  • In NetBeans I can right click any directory in the project explorer and go to Mercurial->diff to get a visual diff for all files (in the directory I clicked) that have changed since the last commit.

    When I right click a directory in Eclipse I am given a compare with but with only 1 option (each other) that is disabled.

    Even worse, when I right click an actual file I know has changed and go to compare with I am given 3 options (local history, parent changeset, different changeset). If I click parent changeset it does not give me a diff. I assume this is beacause its the first time the file has changed since 3 commits ago. Which doesn't make since, I just want to see what I have changed to review it before commiting. I would like this to show me the changes I have made since my last commit i.e. the changes I will be committing.

Please note I am not trying to bash on Eclipse and I am not trying to Praise NetBeans. I am just wanting to know if there is a way to setup a workflow in Eclipse like I am used to in NetBeans.

Clarenceclarenceux answered 19/9, 2011 at 19:45 Comment(0)
D
3

Some of the things you are requesting are not specific to the VCS you are using, they are part of the Eclipse Team support, so they will work with any VCS system.

1) Showing the code changes: The closest Eclipse has to that is Team -> Show Annotations, but I don't think this will show the added/changed/deleted lines from the current version. I would file an enhancement request to Eclipse about this.

2) Eclipse shows different icons for added and changed files. You should see a blue + for an added file and a brown * for a changed file.

3) To easily get a diff from what's committed, you can do Team -> Synchronize. This brings up the Synchronize View. Another way is you can do a Team -> Commit at any level and then in the listing of the files, double-click the file which will bring up the comparison between the files (that will show one file at a time). Another thing you can do is select Compare -> Another Revision... and select the desired revision in the dialog (this will show all enclosed files in a single compare editor). Finally, the Compare -> Parent Changeset on a specific file does shows the changes from the committed parent for me, even if it was not changed in the most recent revision. It's possible you have encountered a bug in Mercurial Eclipse.

Be sure you are using the latest version of Eclispe and also Mercurial Eclipse. Mercurial Eclipse is pretty active and they are adding and fixing things all the time. I tested this on Eclipse 3.7.1 with Mercurial Ecipse 1.9.1.

Deviate answered 13/12, 2011 at 11:45 Comment(0)
N
2

This is an older question, but i had the same problem, and found this info useful.

I'm transitioning from netbeans to eclipse. I'm no expert but:

  1. For text highligting you can use the "quick diff" a. Windows -> preferences -> General -> editors -> quickdiff b. enabling quick diff with mercurial quickdiff seems to mimic netbeans mostly.
  2. For diff's of a changeset of files. I think you need to use the Team Syncroniztion perspective as is mentioned before. Its actually pretty slick once you get used to it.
Nigro answered 9/3, 2012 at 2:2 Comment(1)
As a caveat, the mercurial quick diff is unreliable presently, compared to NetBeans, even though it's much better to have than nothing. (I last tried on Mercurial Eclipse 2.1.0 in Eclipse Luna) If there's a change outside of Eclipse (commits, update, shelve, etc), it's unpredictable whether the editor's diff state will refresh. When it doesn't, there's no guaranteed way to refresh (even restarting Eclipse doesn't always work), so I'm never certain if I'm looking at correct diffs. bitbucket.org/mercurialeclipse/main/issue/337/…Guaiacum

© 2022 - 2024 — McMap. All rights reserved.