How can I query TFS to get a list of changesets that need to be merged into a parent branch?

StackOverflow https://stackoverflow.com/questions/8189257

  •  04-03-2021
  •  | 
  •  

Question

We are using TFS2010 for source control, the source repository has 3 main branches; MAIN, REL and DEV

Consider this scenario: Several developers are working in the REL branch (fixing shipping issues). As they work their changes are checked into the REL branch tested and subsiquently merged back into the MAIN branch.

When developers perform their merge (using the source code explorer in VS2010) if they pick the "selected changesets" option the dialog performs some sort of query and presents them with a list of candidate changesets that exist in the source (REL) branch that have not yet been merged into the target (MAIN) branch.

Given that there may be a delay between the DEV commit and the subsiquent merge we are finding people "forgetting" some changesets.

What I would like to do is create a work item query or Excel report that can reproduce the dialogs query results so we can add this to the projects SharePoint portal.

Specifically: given the current user, and a source and target branch name can I use WIQL or a Excel document to retrieve a list of changesets not currently merged into the target branch.

Can anyone tell if this is possible? and better still tell me how to do it!

The question TFS: List changesets that have not been merged asks a similar question but the aswer alludes to a "write your own code" solution, I would like to pull this off with the "out of the bag" tools; Excel or WIQL.

Was it helpful?

Solution

Take a look @ this answer

How can I check which branches a TFS 2008 changeset has been merged into?

They outline the tf merge command to list the changesets that need to be merged.

When I had to do something like this I ran a command similar to the one in the answer above and fed it into a text file, with a little bit of tweaking, you could probably turn it into a .csv then open it in excel and filter it by user etc.

OTHER TIPS

To my knowledge, WIQL is all about retrieving exclusively Work Items - so this aspect is a dead end.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top