My blog has moved!

Please visit
http://blog.programmerslog.com
and update your bookmarks.

03 October 2006

TortoiseSVN + VS.NET 2005 = Good Stuff

See the update here.

As promised it is time to integrate TortoiseSVN into Visual Studio 2005. The easiest way I have found to do this is to post the vsettings files from Visual Studio once the environment is set up.

Here are the zipped settings files:
This link is for Visual Studio.NET 2005.
This link is for Visual C++ 2005 Express.

You need to go to Tools->Import and Export Settings and load the files from wizard dialog that pops up. There are differences between the free Visual C++ Express and Visual Studio settings files, so please make sure you use the correct one. It would also be an idea to say yes when the wizard asks you to back up your current settings.

There is one thing the settings get wrong on the build toolbar which is the size of some controls, so once the settings have loaded make sure you resize the items on the build toolbar by right-clicking and choosing Customise.... Then you can select the items and make them smaller.

The settings have some of my own personal changes as well as the Subversion changes I am afraid, but you can choose which bits to load in on the settings wizard dialog. There are some assumptions made also, the PlatformSDK is assumed to be in the default environment location under c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK. Also it assumes that TortoiseSVN is installed in the default directory. The settings files are just XML so you could alter those directories by hand before loading it in.

Once you have loaded these settings you will have:

  • A Subversion Menu.
  • A consolidated help menu so the same number of menus is still there at the top.
  • A Subversion toolbar.
  • All Subversion options in menus and toolbars have icons associated with them that will look familiar to users of TortoiseSVN.
  • The context menu for Solutions has relevant Subversion options.
  • As do individual files context menus - Diff, Log, Blame.
  • Since Subversion has its own menu they are no longer present in the External Tools.
  • Made the build bar actually have build options on it.
  • Trimmed down the main file toolbar.
  • All of the moving around of items means you get all the toolbars across the top of the screen in one row.
  • Added quickwatch to the debug menu as it annoys me they removed it after Visual Studio 6.0.
Menu screenshot:

Toolbar screenshot:

Solution context menu:

File context menu:

Well, if anyone has any improvements let me know...

27 comments:

Dean said...

Works like a charm!

On Vista Build 5744 (RC2) x64, it's brilliant, the only thing i would say is missing is an 'Add to repository' function for the solution, but you know what i wouldn't know where to start with that so i'm happy with it as it is!

Superstar, thanks mate.

Garry Bodsworth said...

Hi there Dean,

Thanks for trying this out, it's great to know it works on other platforms.

I'll look at adding the "Add to repository" functionality today as it would be useful. I've always imported via the commandline in the past.

Thanks,

Garry

bral said...

This is just what the doctor ordered. Very useful.

Frank said...

Any chance that we could get a version with only those changes related to TortoiseSVN? even importing only "External Tools List" and "Menu and Command Bar Customizations" fools with things that I dont want fooled with.

Echo said...

Hi,

I'm new to both VS.NET 2005 and TortoiseSVN (formula for disaster). I tried your setting, it seems worked, but in visual studio I only get "Commit" option available, with all the others greyed out. All the options are available after the installation of TortoiseSVN. Where else should I check in order to get other options work in the visual studio? Thank you very much for your help!

Cheers,

Echo

Garry Bodsworth said...

Make sure you are using the updated version, but it shouldn't have anything greyed out (that tends to happen if the application - TortoiseSVN in this case - is not installed).

What you need to do is first install TortoiseSVN in the default location, then import the settings. There are some quite odd issues with settings in VS2005, so sometimes you have to import the settings more than once before they take permanently.

spthorn said...

You need to set your Source Control Plug-in Selection (in Tools | Options) to None, else certain menu options will be disabled.

Nikola said...

and why don't you use Ankh?

http://ankhsvn.tigris.org/

Garry Bodsworth said...

AnkhSVN is too heavyweight. It is fine for people who don't want to leave the SourceSafe working methodology.

When you realise you are no longer working in SourceSafe, all of the items like ticking items in the tree view are purely incidental. You can now edit anything, undo your changes easily, and work in a seamless manner.

The reason for integrating it in this manner was so I didn't need to swap from VS2005 to Windows Explorer to perform operations. Plus the TortoiseSVN UI is a accomplished.

Nikola said...

Wanned to try your approach but it doesn't seem to work with VS2005 SP1?

nkerkin said...

I had a few problems setting this up. My recommendation is to only select
All settings
--->General Settings
------>External Tools List
------>Menu and command Bar Customizations
Ignore the little yellow warning icon on External Tools list, it won't work if you don't select it.

cogitative said...

Thank you for doing this this is exactly what I am looking for, but when I install I am also getting the buttons greyed out. I checked the vssettings file and the path to tortoise is correct. I also have my source control plug-ins set to none. I have tried to import the settings many times. Any other suggestions?

Michael said...

First of all thanks for nice solution. It is very useful.
I had also part of menu greyed out when imported all setting (default). After going back and trying nkerkin's suggestion solved that problem. I works great

Manish Joisar said...

I have done as per your setting, but i am not getting file wise Update/Commit/Get Lock/Release Lock/Revert. So i can get same way like i am doing it in VSS. It will be great if someone can solve this issue. And i am only interested in VS2005, Subverion, TortoiseSVN & vssettings. Not at all interested in any other tools. I think Garry's Bit can solve this. Please help me.

Garry Bodsworth said...

To get the file based Revert/Commit/etc. you need to alter your external tools.

What you should do is go to the "Tools" menu, and click on "External Tools...". For instance, select commit and change the "arguments" from:
/command:commit /path:"$(SolutionDir)" /notempfile
to:
/command:commit /path:"$(ItemPath)" /notempfile

And then change "Initial Directory" from $(SolutionDir) to "$(ItemDir)"

Repeating similar edits (replacing Solution with Item) will worki for most of the TortoiseSVN commandline tools in the External Tools.

Bjørnar said...

Is there a way to get the Tortoise icons in Solution Explorer with this solution? That would be very nice ;o)

Yasith said...

nice stuff! good work this is gonna help a lot of people...

John Black said...

Hi Garry,
Thanks a lot for this. It is exactly what I need, I've done as your guide, and I have a problem that I can't see any changes in the file context menu on the Solution Explorer windows (the Toolbar and Solution context menu work well). I've also tried your update, but it's still not work.
Please help me.
Thanks again.

Yury said...

Hi Garry!
Great job, thanks.
I also got a problem with the greyed out items.
It happens because of that some "assumptions" are hard-coded and in localized OS vesrion the "Program Files" folder doesn't alway appear to be like that. E.g. in German one it is "Programme".
So, the resolution is obvious. Either to edit the corresponding part of the path name for the commands under the External Tools or to change it in the .vssettings file.
To have a universal solution this part of the path should contain the system variable %programfiles%

BR,
Yury

Earthly said...

Does this modify the 'Delete' command on a file? hence delete should be performed as a combination of 'ExcludeFromProject'+'SVN.Delete'

I'm just very curious - i'm evaluating my options and would be making the move to VS 2008 very soon.

PRADEEP said...

Use ankh SVN. Makes life siimpler

unRheal said...

As pre what nkerkin said...
You at the very least *have* to select the "External Tools List" - even though it's both *NOT* selected by default, and it also has a mysterious yellow exclamation icon beside it!

Leaving it at the default unselected, will give you all the options except "commit" grayed out, as some people complained about!

(and maybe only selecting the two options as nkerkin indicated will prevent the other undesired changes that someone else complained about, while still giving the desired SVN functionality - I just haven't tested the full functionality yet...)

Khánh Đỗ said...

Very very useful! Thanks for your sharing very much.

Jorge Fernando said...

if i want to c# 2008 how integrate the svn.. :$

uiyui said...

welcome to the wow power leveling, cheap service site, buy cheap wow gold,wow gold,world of warcraft power leveling buy wow power leveling

ASPX Beginner said...

Is it possible to use this with Visual Studio 2008?

SewhatSneev said...

cheap products for man penis enlargement ideal penis enlargement
penis enlargement pills penis enlargement pills
penis enlargement exercises fast weight loss supplements fast weight loss
penis enhancement
natural penis enlargement