Search code examples
visual-studioversion-controltfstfs-sdk

TFS: How to compare changesets between two branches


How can I find changesets in Branch A that were not merged to branch B programmatically. This what Merge Window does in TFS client GUI but I need to programmatically get the list of changesets.

Say I have Microsoft.TeamFoundation.VersionControl.Client.Workspace reference.


Solution

  • You probably want the VersionControlServer.GetMergeCandidates() method. This gets the candidates for merging between two paths.

    public MergeCandidate[] GetMergeCandidates(
        string sourcePath,
        string targetPath,
        RecursionType recursion
    )