1

Using SSMS and connecting to the TFS server I am attempting to select a list of all change sets which have yet to be merged to other branches within the same project, and am at a loss as to which tables to utilize, or how to join them.

The goal is to present information in such a way that it generates a result set as:

UserName | CountOfUnmergedChangeSets

User1 | 32

User2 | 1

User3 | 10

I see that there is "dbo.tbl_ChangeSet" ins the project database, and another titled "[dbo].[DimChangeset]" in the [Tfs_Warehouse] database. I also see the dbo.tbl_MergeHistory, but have not been effective in determining how to use that along with the changeset tables.

william.eyidi
  • 2,315
  • 4
  • 27
  • 39
user5551344
  • 73
  • 1
  • 5
  • 3
    **Do not** report directly against the team project collection databases. The warehouse is the only supported option for reporting. – Daniel Mann Jan 13 '16 at 01:49
  • 1
    This information is probably much easier to gather using the TFS Client Object Model, than through the database directly. There are so many thins which can be tracked through branches and merges that I'd not even know where to begin in the database or what all the different flags and numbers would mean. Plus, Microsoft can change the inner meaning of the tables without notice. – jessehouwing Jan 13 '16 at 08:38

1 Answers1

1

Just as Daniel mentioned, it's not recommend to query information from TFS database directly. You can use TFS tf.exe merge command (also can be used in the PowerShell script).

tf merge /candidate /recursive BranchA  BranchB

This command will show you all the changesets that were made to BranchA but haven't been merged into BranchB.

Another option is to use the API to achieve your purpose.VersionControlServer has a property named GetMergeCandidates which returns an array of MergeCandidate which has the changeset and if it has been partially merged already as properties. Here is also a similar question TFS: List changesets that have not been merged for your reference

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62