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

杀马特。学长 韩版系。学妹 提交于 2019-12-18 13:01:25

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/15410110/is-there-a-way-to-find-out-the-source-changeset-from-which-a-particular-branch-w

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!