views:

296

answers:

2

In Team System, I have a file that was changed in branch ServicePack\2.1 (which was branched from Integration) and I don't want to merge it to Integration. How do I delete it from the potential changeset list when I try to merge selected changesets?

A: 

While you can't "delete" a merge candidate, it is possible, when merging that file, to select the "accept target version" option.

This will mark the file as merged, but not make any changes to the target. While not the most elegant of solutions it'll do what you need.

Damien Ryan
Even if there are not conflicts?
NotDan
I see what you mean. I can't see how you can do that in an elegant way, but you can do the merge as normal and then overwrite that file with the contents of the target branch on checkin.TFS needs to support this use case the way Perforce does.
Damien Ryan
This is a dangerous. Even if you are careful to preserve the file contents exactly, TFS won't record the merge history as AcceptYours.
Richard Berg
Then what would you suggest?
Damien Ryan
I posted the answer.
Richard Berg
Thanks. I've been looking for this for ages.
Damien Ryan
+2  A: 

Assuming you want to remove candidate #1234...

tf merge ServicePack\2.1 Integration /r /version:1234~1234 /discard
tf checkin
Richard Berg
Perfect! Thanks!
NotDan