views:

459

answers:

4

I can't seem to find an easy way of doing this.

We have a trunk, which has a particular set of Changesets checked into a Work Item in TFS. I want to exclusively merge the changesets in this Work Item into another branch.

Surely this can't be difficult?

A: 

You should be able to do this in a normal merge by simply selecting the changesets you want.

  1. Open Source Control Explorer window in VS
  2. Right click on the trunk (the folder that the original branch was made from)
  3. Select Merge
  4. Select the target branch to merge to from the dropdown list (if it doesn't appear then you probably selected the wrong source directory)
  5. Pick the "Selected Changesets" option
  6. Hit Next
  7. Select the changesets you want to merge

I'm not sure if there's a way to do it from the workitem itself.

Herms
Thanks for your answer, but you don't know of doing the same thing but just selecting a work item. Crazy, why didn't they include that feature.
danswain
I've never found the ability to do it by work item. It's possible there's a way to do it via the powertoys, but I haven't found one.
Herms
A: 

This can be quite difficult, because afaik tfs does not support what is sometimes called "cherrypicking", i.e. merging a few otherwise unrelated changesets into a branch. Tfs expects that you merge the whole branch up to a certain version, without leaving any changessets out. I'm afraid what you're asking isn't directly possible.

You could do it manually, but for a large number of changesets it will be painful. The "links" tab in the workitem contains all changesets ids that were associated with the work item - that could give you some help.

Kurt Schelfthout
+2  A: 

TFS absolutely does support cherry-picking. However, the range of changesets you cherry-pick must be contiguous. If you need to merge a set of changesets that has "gaps" in it, you'll need to run Merge multiple times. If the merge operations end up touching the same files, you will probably need to Checkin between merges.

Richard Berg
A: 

You may want to look into this tool: http://wicreator.codeplex.com/Wiki/View.aspx?title=MergeByWI

William D. Bartholomew