Show Merge - Where from this Code came into Result Pane?

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
shaileshdwivedi
Posts: 17
Joined: Tue Oct 03, 2006 9:59 am

Show Merge - Where from this Code came into Result Pane?

Post by shaileshdwivedi » Thu Nov 16, 2006 2:21 pm

I ran "Merge Branches" in my repository this morning. When I went to "Pending Change Set" I noticed some of the file having "Details" as "Neds Merge" (Refer: Screen-1). I right click on one of the file called "MedicalInterview.vb" and selected "Show Merge" (Refer: Screen-2). Since "Auto Merge" is enabled in my Vault Client, it did ran Auto Merge and prompted me the result. I have few conflicts to resolve (Refer: Screen-3).

If you look at the "Merge Result" pane in the center in Screen-3, you would notice the "For loop...and If blocks within it..." highlighted in Yellow as conflict. However, I don’t have the "For loop...." block in Origin file (Right Pane). Where from this different version of the "For Loop ..." block got copied over to "Merge Result" pane. Note: The "For loop.." block in he center pane is different than the left pane (Target Pane).

I checked couple of version back in the history in the Source (Origin) to see If that particular version of "For loop.." block ever existed. I didn’t find it. So where from that block came?

I don’t have any changes going on in my "Target", I is just the changes in "Origin" that I am trying to carry over to "Target".

Thanks,
Shailesh Dwivedi (Shy)
414.299.8676
Attachments
AfterMergeBanches-ScreenShots.doc
(359.5 KiB) Downloaded 368 times

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Thu Nov 16, 2006 4:41 pm

It looks like you want to overwrite this yellow block in the Target File with the unchanged portion of the Origin File and remove all the text in the yellow highlighted area. However, Vault is trying to merge the two sections, with the suggested merge results in the middle.

Sometimes the algorithm used for merging can't determine the proper merge and files are put in a Needs Merge state for human intervention. If you click on the yellow rectangle to the right of the Merge Result, the original file changes (actually no changes) will be used in the merge result.

I'll contact our Diff/Merge developer to see if he has additional insights about this merge view.
Linda Bauer
SourceGear
Technical Support Manager

shaileshdwivedi
Posts: 17
Joined: Tue Oct 03, 2006 9:59 am

Post by shaileshdwivedi » Thu Nov 16, 2006 9:52 pm

Yes, what you saying is expected behavior. However, in this particular scenario what happened is that Merge Result pane has portion of the changes (Not Complete) from Target. Ideally what should have happened is that It should have either carried over full highlighted code block from Target or It should have completely got rid of that block (to match Origin). But, it got just a portion.

So, my concern is Merge Result is showing the code that is neither from Target nor from Source.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Fri Nov 17, 2006 4:31 pm

I consulted with a few of our developers about what you are seeing in the merge window. The center panel should be the "common ancestor" of target and origin. It looks like the block of text in the middle pane was deleted in the Origin file (right) and someone added 4 lines to that block in the Target file (left).

I know you've looked at the file history in the Origin file, and didn't find this text. If this file was branched, the common ancestor might have been the file it was branched from.

Try this:
Show History on the Origin file and find the version that shows Branched from . . .

Select this version then select the top line (latest version) in History and do a diff. Is that block of text there?

Next:

Show History on the Target file and find the version that shows "Branched from . . ."

Select this version then select the top line (latest version) in History and do a diff. Is that block of text there?

Or -- It could be that Target was not directly branched from Origin, so you're merging into two files that don't have a common ancestor and the center pane contents are coming from a different branch.

I wish we had a definite answer for you. We'd have to reconstruct what had happened to the original file prior to any branches or merges.

In spite of all that, the tool is working as it should -- since Vault doesn't know what do to about the conflict, it puts the transaction in a Needs Merge state so you can decide how to merge it.
Linda Bauer
SourceGear
Technical Support Manager

Locked