Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"SVN Blame" plugin for VisualStudio

I found this question but the referenced options don't say anything about supporting "blame". What I'm looking for is an integrated way to ask "Who edited the line under the cursor last?".

I know most/all SVN clients give this in some form but I'd like something that makes it easy enough that I can do it on a whim: "Humm, who wrote that? [tap tap] Oh him."

like image 913
BCS Avatar asked Jan 19 '09 22:01

BCS


People also ask

What is SVN blame?

svn blame — Show author and revision information in-line for the specified files or URLs.

What is SVN in Visual Studio?

VisualSVN is a transparent integration of the Subversion version control system to the Visual Studio development environment. VisualSVN allows you to take full control on any changes in the project that are made by you or your colleagues.


2 Answers

The daily builds of AnkhSVN 2.0 have a completely new annotate (blame) implementation inspired by the TFS annotate feature.

AnkhSVN Annotate Preview
(source: qqn.nl)

Not really visible in these screenshots, but it uses the Visual Studio editor for syntax coloring, etc. (You can see the sizeof() in the right bottom of the next image is blue). As you can see in the second picture it also allows several commands on the revision regions in the left bar.

It currently doesn't implement the jump to active line. But you can use the Visual Studio goto line (Ctrl+G) command in it. (You might be able to script this in a macro)

The easiest way to start annotate is right click on the editor ->Subversion->Annotate.

AnkhSVN Annotate Commands
(source: qqn.nl)

[Update 2009-02-03: This feature is now commonly available in the new Stable release]

like image 73
Bert Huijben Avatar answered Sep 17 '22 14:09

Bert Huijben


I wrote a Visual Studio macro to get line number info and pass it to tortoiseproc.exe (which is part of TortoiseSVN)

Take a look at the parameter info: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html

Here is my macro:


Sub Blame()
  sCurrFileFull = DTE.ActiveDocument.FullName
  Dim activeDoc As Document
  activeDoc = DTE.ActiveDocument
  Dim nLine As Integer
  nLine = activeDoc.Selection.CurrentLine

  sShellCommand = sTorEXE & " /command:blame /startrev:1 /endrev:-1 /path:""" &
                   sCurrFileFull & """ /notempfile /line:" & nLine.ToString()
  Shell(sShellCommand, AppWinStyle.MaximizedFocus, False)
End Sub
like image 23
crashmstr Avatar answered Sep 20 '22 14:09

crashmstr