Comparing with the Latest Version in the Pending Changes Window



Usually before checking in to TFS Version Control, I will navigate to the pending changes window and compare/diff with the latest version to see what changes I have made.  It’s a good habit to go through just to make sure you aren’t checking anything in that you don’t intend to be committed.

I’ve just been doing it the long way every time by choosing the option from the context menu.

Compare with Latest Version in TFS Pending Changes Window

A client asked if there was a quicker way and I ended up finding out that there are two undocumented features to diff the files in the pending changes window:

  • Shift + Double-Click on the Item
  • Shift + Enter on the Item

Updated – (7/1/2010 11:45 AM)

You can use a registry key to even swap the view/diff behavior in the Pending Changes tool window.  Setting this registry key will make double-click/enter run compare, and shift+double-click/enter view the file.

  • Path:     HKCU\Software\Microsoft\VisualStudio\<ver>\TeamFoundation\SourceControl\Behavior
    • <ver> = 10.0 for Visual Studio 2010 & Team Foundation Server 2010
    • <ver> = 9.0 for Visual Studio 2008 & Team Foundation Server 2008
    • <ver> = 8.0 for Visual Studio 2005 & Team Foundation Server 2005
  • Value:   DoubleClickOnChange (DWORD)
    • 0 for view as the primary command (default)
    • 1 for compare as primary command

How about that?

 

Ed Blankenship



Wednesday, 22 June 2011 18:26:57 (Pacific Daylight Time, UTC-07:00)
Awesome! Thanks for sharing!
clee
Saturday, 03 September 2011 05:03:37 (Pacific Daylight Time, UTC-07:00)
This is great. Good find! Thanks for writing up. Would you happen to know of an extension or way to undo the checkout on any file that does not have changes?

Thanks!
Tom
Saturday, 03 September 2011 05:23:25 (Pacific Daylight Time, UTC-07:00)
Hi Tom,

I don't know of an extension at the moment that does what you are looking to do. Interesting concept though! Actually, in the next version of TFS, Brian Harry has already mentioned a new type of workspace where the problem you describe is taken care of for you. He has more information about it here: http://blogs.msdn.com/b/bharry/archive/2011/08/02/version-control-model-enhancements-in-tfs-11.aspx
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview