Merge Branches problem

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
andrews
Posts: 55
Joined: Tue Feb 05, 2008 7:40 pm

Merge Branches problem

Post by andrews » Mon Mar 17, 2008 8:33 pm

I ran a simple, yet true-to-life, test to evaluate Vault 4.1's branch merging features. The test was as follows:-

1. Created a branch of a folder containing a text file.

2. Edited the text file in the branch, adding in 2 new lines.

3. Edited the file in the original folder, adding 2 new lines, one of which will conflict with the change in the branch.

4. Merged the branch back to the original folder.

I expected it to tell me that it couldn't merge the file, which it did, leaving the file unchecked. I then expected that if I checked the file it'd mark it as "Needs Merge", so I could later open a 3 way diff to allow me to resolve the conflicts. This didn't happen. Instead it just marks the file as "Edited". If I commit the merge, the target file will be overwritten with the one from the branch and all its changes lost. It didn't make any difference whether I ticked "Attempt Automatic Merge" or not. With the file not marked as "Needs Merge" there doesn't seem any way of bringing up the 3 way diff.

Is this how Vault is supposed to behave or am I doing something wrong?

If we've had a team of developers working for a month or two on a branch while other people work on the "tip", it will be very difficult merging changes back to the tip. We'd have to take note of the names of each file that Vault can't merge, then manually do "diffs" and resolve the changes before attempting the merge again...

Perhaps my understanding of Merge Branches is wrong and there's another way of going about this task?

On a related note, if I have files that Vault can merge successfully, there doesn't seem to be anywhere I can review exactly how its done the merge (apart from manually running diffs). It appears Vault just expects you to trust it.
Last edited by andrews on Tue Mar 18, 2008 3:44 pm, edited 1 time in total.

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Tue Mar 18, 2008 8:17 am

The missing step is that you must do a "Show Merge" command on each of the Needs Merge files in your changeset before they can be committed to the server. You can do that by right-clicking the needs merge file in the pending change set, or in the file list. You will also be prompted to perform the merge if you attempt to commit a Needs Merge file. Any of those things will bring up the three-way merge that you're expecting.

andrews
Posts: 55
Joined: Tue Feb 05, 2008 7:40 pm

Post by andrews » Tue Mar 18, 2008 3:42 pm

I'd gladly do a "Show Merge" on the Needs Merge files. As I said in my post though, the files aren't being marked as Needs Merge, they're being marked as "Edited" and the Show Merge item on the context menu is greyed out when I right-click. If I commit, the files in the target folder are zapped, overwritten with those from the source folder.

I'm quite sure I performed this test with 4.0.6 and didn't have this problem. We're just finishing our evaluation now and until we hit this issue everything was looking good...

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Tue Mar 18, 2008 4:13 pm

I just tried a simple merge as you described, and the file was marked as needs merge. Were you testing with a binary file which couldn't be merged?
Attachments
andrew.png
andrew.png (35.92 KiB) Viewed 3212 times
andrew2.png
andrew2.png (26.66 KiB) Viewed 3212 times
andrew3.png
andrew3.png (29.9 KiB) Viewed 3212 times
andrew4.png
andrew4.png (44.86 KiB) Viewed 3212 times

andrews
Posts: 55
Joined: Tue Feb 05, 2008 7:40 pm

Post by andrews » Tue Mar 18, 2008 4:33 pm

Jeremy, thanks for running the test. You've hit the nail on the head - the file wasn't binary, but the extension (.sh) wasn't listed on Vault's file types.

:: kicks self repeatedly ::

Thanks for your help, its all working now & our blood pressure's returned to normal :)

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Wed Mar 19, 2008 7:25 am

Thank goodness! You had me worried for a while.

Post Reply