Scott Hanselman

AnkhSVN: Using Subversion within Visual Studio

August 17, '06 Comments [9] Posted in Musings | Tools
Sponsored By

Ankh1rc2Congrats to Arild for releasing AhknSVN RC2. If you're looking to use Subversion within Visual Studio, perhaps at work or perhaps you're working on an Open Source project at SourceForge, this is the tool for you.

NOTE: If you do use TortoiseSVN at the same time as Ankh, do note that they are linked to Subversion 1.4, so they will upgrade your local SVN working copies. Make sure you upgrade both at the same time.

To be clear:

IMPORTANT NOTE: TortoiseSVN 1.4.0-RC1 is linked with the Subversion 1.4.0-RC4 libraries. Due to various improvements made to the working copy library, the working copy format has changed. Using TortoiseSVN 1.4.0-rc1 on any working copy created by previous versions of Subversion/TSVN will TRANSPARENTLY upgrade your working copy, which means that production-ready versions of Subversion/TSVN (1.3.x and earlier) will no longer be able to read it! Please be careful, if you use other Subversion clients (eg. the 1.3.x command line client), not to use the TortoiseSVN 1.4.x release candidate on a production working copy.

As with all things, YMMV and back up your life.

ADDITIONAL NOTE: If you get "Unable to retrieve folder information from the server" when using VS2003 in a Web Project, you may need to go into your TortoiseSVN settings and set "use ASP.NET Hack" which tells Tortoise to use folders name "_svn" to store details rather than folders named ".svn".

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Friday, August 18, 2006 2:34:37 AM UTC
Have you, or anyone else, had an experience with this plugin?

http://www.visualsvn.com/

I plan on d/ling it and trying it next week when I'm at work.
Friday, August 18, 2006 6:15:45 AM UTC
I started using AhknSVN a month ago, but it just wasn't for me. I didn't like that the minute I added a file to my project, it did an 'Add' to SVN. I like to choose when to add myself.
Friday, August 18, 2006 7:42:15 AM UTC
Scott Elkin: Autoadding new files is an option, configurable in the configuration dialog. I used to feel the same way you did, but enough users wanted this behavior to be the default so I yielded.
Friday, August 18, 2006 7:12:41 PM UTC
I liked the last version, but love this one! Thanks, Scott, for announcing it here! Thanks Arlid for the MAJOR improvements! Speed of committing and updating prevented me from trying it any further. Now, I'll give it a full test!
Saturday, August 19, 2006 11:12:05 PM UTC
You should check out PushOk's SVN SCC plugin (http://www.pushok.com/soft_short_info.php). It's $24 a licence but has very good support and is alot more stable than AnkhSVN. You can also try if for a month for free before purchasing.
Sunday, August 20, 2006 4:40:40 AM UTC
Damien - I haven't found Ankh to be unstable at all...to what are you referring?
Scott Hanselman
Sunday, August 20, 2006 9:59:22 AM UTC
Why is everytime i mentioned subversion, to -- especially VSS crowd , all they want is IDE integration. I'm sick of having too much in distraction while coding. Back in our place, we will not allow anksvn, tortoise or any visual client, it only make them lazy. up to the point that they don't even know what subversion has to offer, cause their brain we infected by vss virus.

with svn.exe , the posibily is endeless, we wrapped it inside our build with NAnt and for interactiveness they are always powershell and stuff.

here's one example for our commit.build
%lt;!-- invoke svn up, and examine the updated item if it contains table the rebuild database --%gt;
%lt;echo message="[Please examine these new files" append="false" file="st.log.txt"/%gt;
%lt;echo message="if you need it then add , else delete or ignore]" append="true" file="st.log.txt"/%gt;
%lt;echo message="" append="true" file="st.log.txt"/%gt;
%lt;exec program="svn" commandline="st" failonerror="true" output="svn.st.log.txt" append="false"/%gt;
%lt;foreach item="Line" in ="svn.st.log.txt" property ="newfile"%gt;
%lt;if test="${string::starts-with(newfile, '?')}"%gt;
%lt;property name="has.new.file" value="true"/%gt;
%lt;echo message="${string::replace(newfile, '?', '')}" append="true" file="st.log.txt"/%gt;
%lt;/if%gt;
%lt;/foreach%gt;
%lt;if test="${has.new.file}"%gt;
%lt;exec program="n" commandline="st.log.txt"/%gt;
%lt;exec program="cmdcolor" commandline='-c Red "Theres new uncommited file, ignore, delete or add"'/%gt;
%lt;fail message="There's new uncommited file, ignore, delete or add"/%gt;
%lt;/if%gt;
erymuzuan
Thursday, August 24, 2006 3:56:27 AM UTC
I have a solution,which has a website,all other projects are added by ankh,but not website project..i had to manually add it.Is it so?
vishy
Monday, August 28, 2006 2:47:01 PM UTC
I have been a happy AnkhSVN user since I started to use VS.NET 2003 two years ago, and I have always been using TortoiseSVN on the side. I was already familiar with CVS and SVN before; I have never used VSS.

Frankly I don't understand erymuzuan's comment.
The nice thing about IDE integration, and hence about AnkhSVN, is that it is aware of the composition of your development solution: it knows which files belong to it and wich do not, and it also knows when one logical unit consists of multiple files (e.g. System.Windows.Forms.Control subclass, which has a code file and a resources file). Automatically adding a file to version control when it's added to a project or solution is exactly the behavior I want!

My main reason for still using TortoiseSVN on the side is that with the old AnkhSVN this abstraction doesn't work as well as I'd like. Renaming project items didn't rename them in SVN. I rename things quite often so I hope this is fixed in the latest AnkhSVN. I did try the current beta of AnkhSVN about a year ago but it crashed on me - I don't recall the details.

Another nice aspect of IDE integration is not having to switch to the explorer for everything related to version control. I very often use selective diffs, selective commits, and selective reverts; this is much more convenient from VS.NET's solution explorer than it is from the Windows explorer (my current solution consists of 19 projects).

So all in all, AnkhSVN saves me quite a bit of time each day. Great to see that it's still moving forward.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.