Tuesday, 28 May 2013

TFS Pending Changes tree model limit

If you’re like me, you have been extremely annoyed by TFS 2012 in a number of ways, and one of those ways has been how the Pending Changes window will never show more than 200 of your pending changes. The exact number is usually less, because if adding a subtree to the view would make it exceed 200 nodes, the entire subtree is excluded. This ends up looking like this:

(Note, interestingly, that for my current set of pending changes, it actually has a tree node for “IQ.Core.Update.Database.ScriptBuilder\Profiles” but it has nothing in it!)

The “official” answer anywhere is that you simply have to click on “Go to All changes”, and then you’re taken away from the Pending Changes view and out of the tree view that you’ve just gotten your head space wrapped around, and you’re looking at an isolated flat list view. Did I mention how annoying I find this? :-P

I got annoyed enough by it just now that I actually decompiled the TFS control in charge of the Pending Changes window and tracked down how and where it actually applies this limit, and to my inexpressible delight I discovered that the limit is actually controlled by a registry key!

There is still a hard upper limit. The code is written in a way that does not allow an upper limit on the number of tree nodes greater than 3,000. However, at that point, with only a few exceptions, it would be quite a reasonable statement to say that if you’ve got that many changes all at once, you’re probably not doing it right. :-)

Okay, so where is this registry key? Here:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\PendingCheckins

This registry key stores all of the settings that control the behaviour of the Pending Changes view. On my system, I found the key already existed but contained no values. (It did have a subkey indicating what the last-used workspace was.)

To expand the number of visible items, then, create a new DWORD value called: VisibleItemMaxCount

Visual Studio needs to be restarted in order to reread this value.

I did exactly this and gave it a value of 3,000 (which, as mentioned, is the maximum – it will simply use 3,000 if you set a larger number). Now, my Pending Changes window looks like this:

Nothing hidden from view any more! (And now “IQ.Core.Update.Database.ScriptBuilder\Profiles” isn’t empty, and actually shows the file in there with modifications.)

Hope this improves your day. :-)