How to programmatically track a set of TFS changes across multiple branches?

I have a TFS change set id and it has been merged across multiple branches. I would like to find all the changes associated with them. Is there a way to use VersionControlServer.TrackMergesthis information to search, or is there another API request for this?

+5
source share
1 answer

Yep, VersionControlServer.TrackMerges () is the API you want to use. In the sourceItem parameter, pass the root of the branch with which you want to track changes. In the targetItems parameter, pass the root of the branches to which you want to track the set of changes. Note that this will only work for the roots of branches having merge relationships. The best way to make sure that this is true is to look at the hierarchy of branches and make branches directly connected or connected using some route.

Suppose you want to track a set of changes from $ / Proj / Main to $ / Proj / Feature2 in a branch hierarchy, for example:

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

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

Let me know if you have any questions.

+3
source

All Articles