Is there a way to find out the source changeset from which a particular branch was created in TFS?

StackOverflow https://stackoverflow.com/questions/15410110

  •  23-03-2022
  •  | 
  •  

Question

My case is the following. My team uses TFS 2012 for source control. My teammate has created a branch from a particular changeset (not the last for that moment) of another branch. What I need is to figure out from which exact changeset the branch was created, and which branch was used.

I tried to find it in "View History" of Source Control Explorer in VS. If to compare with svn, there is a property in the revision of creating a branch that stores the initial revision and initial location from which the branch was created. In TFS, changeset details look loke they do not contain such information.

Was it helpful?

Solution

Yes, there is. discens is right, you might use Track Changeset functionality. By the way, a similar question has already been answered on SO, here it is. The answer contains a link to a blogpost which contains many details, including API and a custom command-line tool.

However, the way is not so obvious. To clarify this, here is a brief step-by-step instruction of how to achieve the result in Source Control Explorer:

  1. Locate your child branch in Source Control Explorer
  2. Right-click on it to get context menu, select View History.
  3. Locate the first changeset of the branch in the History viewer, right-click on it to get context menu, select Track Changeset.
  4. You will see the scheme of branches and the structure of their inheritance. On this step, you are finding out the parent.
  5. There is a checkbox near every detected branch, but the parent one of your child is normally unchecked. Check it first. The child branch has to be checked unconditionally, so the two checkboxes to be selected are the parent and the child.
  6. Don't forget to locate your child branch in Path filter input field using Browse... button.
  7. Press Visualize button at the bottom. You will see the picture with rectangles repesenting these two branches. The parent branch rectangle should include sorted list of changesets in this branch. The list can be huge, but the source changeset (from which your child has been originally created) should be the last.
  8. ???? PROFIT!!!!

You can see a sample screenshot of the final steps in the blogpost.

OTHER TIPS

You can use Track Changeset feature which I believe will show you the history of a branch and what changesets it contains.

You can get to this feature from the Source Control Explorer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top