5

I have a TFS change set ID and it's been merged across several branches. I'd like to be able to find all the associated change set ids. Is there a way to use VersionControlServer.TrackMerges to find this information or is there a different API call for this?

Mykroft
  • 13,077
  • 13
  • 44
  • 72

1 Answers1

3

Yep, VersionControlServer.TrackMerges() is the API you want to use. In the sourceItem parameter, pass the root of the branch you want to track changes from. In the targetItems parameter, pass the root of the branches that you want to track the changeset to. Note, this will only work for branch roots that have a merge relationship. The best way to make sure that is true is to view the branch hierarchy and make the branches are directly related or related through some route.

Let's say you wanted to track a changeset from $/Proj/Main to $/Proj/Feature2 in a branch hierarchy like this:

$/Proj/Main
    $/Proj/Dev
       $/Proj/Feature2

Then you would want to pass $/Proj/Main in as your sourceItem and $/Proj/Dev AND $/Proj/Feature2 as targetItems.

Let me know if you have any questions.

Taylor Lafrinere
  • 3,084
  • 18
  • 27