THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Jamie Thomson

This is the blog of Jamie Thomson, a freelance data mangler in London

Undoing a change will now undo a check-out in Visual Studio 2012

In my blog post SQL Server devs–what source control system do you use, if any? (answer and maybe win free stuff) of 18th October 2012 I complained about one aspect of Source Control in Team Foundation Server (TFS) that infuriates me:

…there are aspects to TFS source control that annoy me day-in, day-out. Chief among them has to be the fact that it uses a file’s read-only property to determine if a file should be checked-out or not and, if it determines that it should, it will happily do that check-out on your behalf without you even asking it to. I didn’t realise how ridiculous this was until I first used SVN about three years ago – with SVN you make any changes you wish and then use your source control client to determine which files have changed and thus be checked-in; the notion of “check-out” doesn’t even exist. That sounds like a small thing but you don’t realise how liberating it is until you actually start working that way.

This evening I have been noodling around in Visual Studio 2012 and noticed that this behaviour has changed, as I shall now demonstrate. I opened an XML file (an SSDT Publish Profile file as it happens) that was checked into TFS Source Control:

image

I made a change to the file and instantly it got checked-out:

image

I then simply hit CTRL+Z to reverse the change I had made earlier and CTRL+S to save. At that instant the earlier check-out was reversed:

image

Finally…TFS Source Control now determines whether any changes have actually occurred before considering the file “checked-out”. I know this seems like a really minor change but I promise you, it delights me – especially given I use TFS so much (not through choice I might add).

Perhaps this new behaviour is common knowledge in the TFS fraternity but it was news to me so I figure it might be news to some of you too. Hopefully I’m not the only one that is suitably enamoured upon learning about it.

Note that I am using Visual Studio 2012 and Team Foundation Service.

@Jamiet

Published Saturday, January 26, 2013 11:41 PM by jamiet
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Aaron Lowe said:

I believe this is enabled via the new functionality in VS 2012 called local workspace.  Basically you're checking in and out to your local workspace as much as you want.  Then you can sync your local to the server as one transaction.

http://msdn.microsoft.com/en-us/library/bb892960.aspx

January 29, 2013 9:19 AM
 

jamiet said:

Ah good to know, thanks Aaron. Sounds as tho a local workspace is a little bit like a local Git repo. Needs some more investigation methinks.

January 29, 2013 9:47 AM

Leave a Comment

(required) 
(required) 
Submit

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement