Given a changeset c and given that c contains merge operations, I would like to get a list of all changesets that have been merged and resulted in c.
For example:
- Changeset 1 contains some edits for some files.
- Changeset 2 contains some edits for some other files.
- Changeset 3 is a merge of changesets 1+2 to a parent branch.
Now I would like to get changesets 1+2 from asking changeset 3 which changeset merges it contained.
I want to do this using the TFS API. I came across the versionControlServer.TrackMerges method, however I do not understand what the ItemIdentifiers that the method expects should be. Unfortunately, I cannot find an example of how to use this method. Also I’m not sure if that is really the correct one.
Okay, it took me really long, but I think I found out how to do this. This is the Code that will find all the “parent” changesets:
Edit:
I just realized that there is a small “bug” in the above code, I used to write “VersionSpec.Latest” in the query, however: “new ChangesetVersionSpec(changeset.ChangesetId)” would be better, because then the changesets would also be tracked once the source branch has been deleted.