Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN blame in Eclipse

Tags:

eclipse

svn

Yesterday, I discovered the Subversion (SVN) blame feature, and I was wondering, is this feature available from Eclipse?

like image 635
David Santamaria Avatar asked Oct 21 '08 21:10

David Santamaria


People also ask

What is SVN blame?

Subversion has a command for this, and it is called blame (guess why). Subversion creates a blame of a file by adding information about the author who committed a line, the revision the line was last changed and the date. TortoiseSVN has its own tool to show you those blames.

How do I view SVN history in eclipse?

Window -> Preferences -> Team -> SVN -> Default number of log messages. Or you can press the ">|" button to see the complete history.

What is SVN repository in Eclipse?

Eclipse is an open-source and free, java-based development platform. It is well known for its excellent plug-ins that allow developers to develop and test code written in different programming languages. Eclipse IDE support built-in integration for Subversion.

How do you annotate in eclipse?

In essence, you right click on the margin and select annotate. After which in the margin you see who the last people were who made modifications to the code per line (like git's blame).


1 Answers

As was pointed out, you would currently have to first install a plug-in to enable Subversion support. I recommend Subversive, myself, and a search here on Stack Overflow for the tags "eclipse" and "subversion" together will show several previous threads regarding "gotchas" to watch out for when installing the connectors (Subversive is separated into two parts-- the core support and "connectors" that provide the SVN glue).

Once you have that installed, you can configure repositories, create new projects by directly entering a new repository address and checking it out, or associate an existing project that was already attached to SVN with the repository by have Subversion look it over.

Once you've done that, this is how you access the "svn blame" command, also known as "annotate" or "praise":

For a resource, right click on the resource name in the file-explorer pane to pop-up the context menu (you can also get this menu by right-clicking anywhere in the editor itself). Under the "Team" heading (which is also where you access all the SVN commands, as Eclipse generalizes source control under the heading of "Team Sharing"), select "Show Annotation". On my Mac PowerBook, the keyboard shortcut for this is Ctrl + Option + A, I'm not near my Linux or Windows XP platforms to see what the shortcut us on either of them (Mac OS X ports tend to tweak keyboard shortcuts to adhere to the "greater good" view of what a Mac application should do).

After a bit of time conversing with the Subversion repository, the left-gutter of the editor window will show a series of colored bars. If you have line-numbers enabled for your editor, these will overlay the numbers. Otherwise, they'll just be bars. Each alternation of color represents a break where responsibility changes from one user to another. If you hover the pointer over a bar, a tooltip will appear identifying the responsible user, the revision/commit that the lines are from, date and the check-in comment. The color of the bars will vary from committer to committer, and revision to revision. They'll be varying shades of the same base color, but Eclipse will try to make them visually distinct (as much as possible). When you're hovering over a snippet, it highlights slightly, and all other bars that are tied to the same revision will also highlight.

(Now, don't ask me how to turn it off. Thus far, my only solution has been to close the buffer and re-open it!)

like image 112
rjray Avatar answered Sep 20 '22 17:09

rjray