问题
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
:
- Locate your child branch in
Source Control Explorer
- Right-click on it to get context menu, select
View History
. - Locate the first changeset of the branch in the History viewer, right-click on it to get context menu, select
Track Changeset
. - You will see the scheme of branches and the structure of their inheritance. On this step, you are finding out the parent.
- 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.
- Don't forget to locate your child branch in
Path filter
input field usingBrowse...
button. - 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. - ???? 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