1

We have a tricky situation with our branches on TFS 2012 and now we are not exactly sure what will be the result of our actions.

The problematic branch structure is as follows:

       /B----2-------
      /
A -------1-----------
            \
             \C---3--

The pseudo diagram is approximately time-correct - at first branch B was branched from A and then later branch C was created. The numbers are the changesets in question (actually our problem involves multiple changesets on each branch, but I've simplified the diagram).

We wanted to merge changeset 3 from C into branch B. Visual Studio warned us that a baseless merge will be performed (obviously, because branches B and C are siblings and not parent-child). The warning was like this one:

TFS baseless merge

We proceeded with merging. Then at some point it came to one developer that we forgot to update our branch B from branch A and that we need changes from changeset 1 in our branch B. But the problem is that changeset 1 has some code lines which were later modified in changeset 3 (branch C) which we merged.

Now the question is, what will happen to branch B when we merge changeset 1 from A into B after we have done the baseless merge of changeset 3 from C into B?

Will TFS be smart enough to keep the changes from the newest changeset 3 when it finds the conflicting code lines of changeset 1, even after we did the baseless merge?

P.S. We'll learn from this mistake and will try to avoid baseless merging in the future...

JustAMartin
  • 13,165
  • 18
  • 99
  • 183
  • 2
    It's not like TFS automatically commits merges when you perform them - you always have the opportunity to review the changes before checking in. So the simplest way to answer a "what will happen when I attempt this merge" question, for me, is to actually perform the merge and see what happens. – Damien_The_Unbeliever May 15 '14 at 08:04

1 Answers1

1

From your diagram, it looks like that 1 is already included in Branch C. So when you merge from "C" to "B", the changes would already include those of changeset 1.

Hamid Shahid
  • 4,486
  • 3
  • 32
  • 41
  • It did not happen because I only picked the changeset 3 from the C branch when merging to B. I don't want to merge entire C to B, but only some changesets. – JustAMartin May 15 '14 at 13:37
  • I see. when it comes to taking some Changesets than whether it includes changes from Changeset 1 depends upon the overlap between changeset 1 and the ones you have merged. To answer your question, for those files, the changes for changeset 1 will be included. – Hamid Shahid May 15 '14 at 14:07