Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blame source file from within visual studio

I'm using AnkSVN within Visual Studio 2010, and it covers ~95% of my SVN needs. The biggest missing feature is that I can't find a way to blame a file from directly within VS. The workaround I currently use is to right click on the file within the tablist, and select Open Containing Folder, and then right clicking on the file in Explorer to call Blame.

like image 414
Dan Is Fiddling By Firelight Avatar asked Apr 06 '11 14:04

Dan Is Fiddling By Firelight


2 Answers

It's called Annotate in AnhkSVN.

Subversion -> Annotate in the context menu.

like image 136
AntonyW Avatar answered Sep 20 '22 12:09

AntonyW


I didn't like AnkhSVN's Annotate feature. So I used the following:
How to integrate TortoiseSVN into Visual Studio.

Content from above url:


If you're using Visual Studio, you can integrate TortoiseSVN commands to various context menus.

The first step is to add the TortoiseSVN commands as external tools, under the menu TOOLS->External Tools....

Add the name of the command, the path to TortoiseProc.exe and then the parameters for the command.

Use the VS variables wherever needed. Since I add my commands to the context menu of the open file tab, here's the parameters I used:

  • /command:blame /path:"$(ItemPath)" /line:$(CurLine)
  • /command:diff /path:"$(ItemPath)"
  • /command:log /path:"$(ItemPath)"

Notice the /line: parameter: this will make TortoiseBlame automatically scroll to the same line the cursor is located in the opened file in Visual Studio.

Now to add those new commands to the file tab context menu, go to TOOLS->Customize..., select the Commands tab, click the radio button Context menu and then select Other Context Menus | Easy MDI Document Window.

Now you have to select the commands. Problem is that the custom commands are not shown with their title but only as External Command X with X being the number of the external command.

In my case, the commands were number 9-11, you might have to do some trial-and-error here. Just add the commands you think are the ones you added and then check if the right ones show up in the context menu.


NOTE: In Visual Studio 2010 to add a command to the right-click menu of a document’s tab, first you’ll need to right-click on a Visual Studio document tab to work around a Visual Studio bug. (Otherwise the Easy MDI Document Window context menu doesn’t show up in the Customize dialog.) Source

like image 35
publicgk Avatar answered Sep 19 '22 12:09

publicgk