Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2010: Branching - Why do changesets say they haven't been merged when they were from before the Branch?

I made a branch and the first time I went to merge from the source to the branch there were a whole bunch of old changesets coming up that it says were not merged but they were present well before the branch and I confirm that they were there.

Example: Say I branched from Source to Target when there were 9 changesets in Source. Change 10 was made in Source. I go to merge from Source to Target and TFS tells me change 6 and 7 and 10 need to be merged (even though 6 and 7 were there before I branched and I can confirm those changes are in the Target)

I am new to TFS and this happened when I first started to implement Branching and Merging. The newest branch I made did not do this.

Right now we have a Trunk and then 1 Branch for the ongoing QA for the next release and another Branch for the Hotfixes to Production. It was the QA branch that had this issue but when I made the hotfix branch it was fine.

like image 426
Shane Fowler Avatar asked Mar 07 '12 19:03

Shane Fowler


1 Answers

I have come across this a few times. I eventually just merged the "rogue" candidate change-sets from source to target. I examined the pending merge and determined that there were no changes. Committing the merge got rid of these candidate change-sets. I figured that I could roll back if it didn't work out.

EDIT: It appears that if you upgraded to TFS 2010, there is a bug that will cause extra merge candidates (see http://support.microsoft.com/kb/2135068)

"Any items on a branch that have been renamed multiple times or have had multiple other items occupy their namespace (through add/delete combinations) will have lost their relationships with the corresponding items on other branches."

As for a resolution, the support article says:

"To resolve the issue with extra merge candidates, the /discard option should be used. To do this, run a merge of the following format from a command line:

tf merge <source branch> <target branch> /r /discard:CXXX~CYYY

In this example, XXX and YYY represent the changeset IDs of the range of changes to discard. After this merge has been checked in, the unwanted candidates will no longer appear for future merges. Also be aware that, because of improvements in the merge algorithm in TFS 2010, items deleted in both the source and target branches will result in changes to be merged. In those cases, it is best not to discard the changesets so that the merge history is updated correctly. "

like image 118
PabloC Avatar answered Oct 11 '22 01:10

PabloC