1

I use a simple branching strategy where I have a trunk. i branch from that trunk into multiple development branches. Once dev is done I merge the dev branch back into main.

I'm looking for a way to produce an automated report that would tell me which branches have changes that have not yet been merged back into the trunk.

I'm sure there is a way to do this with either tf.exe or the tfs database.

user263097
  • 294
  • 1
  • 4
  • 15
  • 1
    possible duplicate of [How to get all unmerged changesets for a branch using TFS 2010 SDK?](http://stackoverflow.com/questions/8201227/how-to-get-all-unmerged-changesets-for-a-branch-using-tfs-2010-sdk) – Pero P. May 29 '13 at 19:02

2 Answers2

2

You could use the API... but it would be easiest to just use tf.exe. I used to have a Powershell script that I executed once each development cycle to catch unmerged changes.

Use with vc or git (below example for vc):

tf.exe vc merge /recursive /candidate "$/source/BRANCH" "$/target/BRANCH" 

You can get the skinny on all of the tf.exe merge options here: http://msdn.microsoft.com/en-us/library/bd6dxhfy(v=vs.100).aspx

Ostati
  • 4,623
  • 3
  • 44
  • 48
Derek Evermore
  • 1,418
  • 1
  • 10
  • 22
2

I found Derek's answer to be correct, but there was a small syntax problem in the call to tf.exe.

The correct syntax is:

tf.exe merge /recursive /candidate "$/Source/Branch/Location" "$/Target/Branch/Location"

This should be run from within a mapped TFS workspace folder, or you may get the error: "Unable to determine the workspace."

You can alternatively use the "workspaces" action on tf.exe before the merge call to specify a collection to target if the machine you're running from has no mapped workspaces.