DiffMerge Bug??

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

Moderator: SourceGear

Post Reply
jsynoski
Posts: 33
Joined: Wed Apr 14, 2004 12:24 pm

DiffMerge Bug??

Post by jsynoski » Wed Apr 21, 2004 8:12 am

Ran DiffMerge on a file. The AutoMerge dialog stated that there were no conflicts. However when DiffMerge came up, a conflict was highlighted. In looking at the line in question, I can't see where it is different in both the working copy and the repository copy.

The repository file is on the VaultDemo server as RegalTest\XCCommonFunctions.slx. The attached zip shows the AutoMerge Dialog, the DiffMerge screen and has a copy of the working XCCommonFunctions.slx. It also includes a view of the GUI screen.

Am I missing something or is this a bug?
Attachments
DiffMerge.zip
(63.96 KiB) Downloaded 928 times

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Apr 21, 2004 8:46 am

Thanks for posting all the files. Unfortunately, it looks like the working file posted is the one after it has been merged (it is identical to version 7 in the repository?). In order to reproduce this, I would need the working file as it was prior to the merge, so that I can have all 3 files the merge uses for computation (it looks like the other two are version 4 and version 7 in the repository).

In general, if the merge window reports a conflict, but the lines are the same, then yes, that would be a bug. However, we would need to be able to reproduce it to see what is happening. If you can get this to happen again, and provide all 3 files that constitute the merge, that would greatly help.

Thanks,

jsynoski
Posts: 33
Joined: Wed Apr 14, 2004 12:24 pm

Post by jsynoski » Wed Apr 21, 2004 9:21 am

Oops! Grabbed the file from the wrong directory.

The attached file should do the trick. Never saved the results of the merge window as I assumed it would just overwrite the file in the working directory.

Just tried merging, using sgdm.exe between the attached file and the one sent earlier and it worked as expected. But I'm still getting the conflict if I use Show Merge from the GUI.
Attachments
XCCommonFunctions.zip
(2.44 KiB) Downloaded 917 times

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Apr 21, 2004 10:10 am

Ok, so the files I'm seeing have differences on line 37 reported as a conflict. The working folder line is:

if (!SearchChildBoolean(handle, Vaw6523452345lue, GroupString,KeyString,dummy.Int) && !SuppressXMLErrors) {

and the latest repository version has:

if (!SearchChildBoolean(handle, Value, GroupString,KeyString,dummy.Int) && !SuppressXMLErrors) {

The lines are different (the "Value" parameter has changed), so this produces a conflict, since sgdm does know which line it should use (sgdm is line based), the line from the working folder, or the line that is currently checked into the repository.

It may be that I have the wrong baselines. What I did was: Invoke Get on version 4 of the file from history, then I overwrote that file in the working folder with the working file that you sent. The status of the file changed from Old to Needs Merge. I then invoked Show Merge, and got the results above. Let me know this isn't the what you are seeing, or whether the steps I'm using are different from yours.

jsynoski
Posts: 33
Joined: Wed Apr 14, 2004 12:24 pm

Post by jsynoski » Wed Apr 21, 2004 12:28 pm

Yes, line 37 is the one that I'm questioning.

So using "Show Merge":
1) Why did AutoMerge dialog indicate no conflicts, whlie DiffMerge then shows a conflict?
2) Why is line 37 different than line 4 which seems to have worked "correctly" (or at least my thinking of correct)

Assumptions:
Your Working File -> File in Working Folder
Repository version -> latest version of file in the repository
Merge Result -> I orignally thought that this was a combination(merge) of the Working File and The Repository File. The title "Merge Results" lead me to that conclusion but after reading the help description of a 3-way merge it is another file. What file is this?

jsynoski
Posts: 33
Joined: Wed Apr 14, 2004 12:24 pm

Post by jsynoski » Wed Apr 21, 2004 1:14 pm

Sequence to reproduce results

1) Set Working Folder to DirA
2) Get Latest Version (overwrite) of XCBooth.slx
3) Checkout XCBooth.slx
3) Set Working Folder to DirB
4) Get Latest Version (overwrite) of XCBooth.slx

goto favorite editor

5) in file DirB\XCBooth.slx edit line 3
6) in file DirA\XCBooth.slx edit line 4


7) Set Working Folder to DirB
8) Checkin XCBooth.slx
9) Set Working Folder to DirA
10) Status of XCBooth.slx is now Renagade
11) Check out XCBooth.slx with "Attempt automatic merge"
12) Status of XCBooth.slx is now Needs Merge
13) Right click Show Merge on XCBooth.slx
14) Automerge Dialog box says no conflicts
15) DiffMerge windows shows a conflict on line 3

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Apr 21, 2004 1:18 pm

By automerge, I'm assuming you mean the dialog that comes up at the beginning of the merge? If so, then yes, that does appear to be misreporting that there are no conflicts. We'll check that out.

For merge operations, there are actually 3 versions of files: your working copy, the current repository version, and the baseline file you started with. From your screenshots, it looks like version 4 was your baseline, meaning you did a get on version 4, started modifying that version of the file, and then other versions were checked in from other places while you were editing. It is also possible that you did a Get on version 4 from history, started modifying that file, then checked it out, which would produce the same results.

There are only conflicts in the file if the same line was modified in both your working copy and the latest repository copy since your baseline (in your case, version 4). Line 4 was changed in the repository version, but not in the working copy, so there is no conflict.

In line 37, both the working file and the repository file had changes on that line since verson 4, which is what produces the conflict.

Hope this helps

jsynoski
Posts: 33
Joined: Wed Apr 14, 2004 12:24 pm

Post by jsynoski » Wed Apr 21, 2004 1:51 pm

I think the fog is starting to clear.

Using Show Merge:
The left pane is your working file - FileW
The right pane is the current repository file - FileR
There is a background baseline file - FileB
and the center pane is a Temp merged version - FileM

When a line from FileB is changed by both FileW and FileR then the corresponding line in FileM is deleted adding the yellow on both sides

----

When I right-click in the Merge Results area I get 2 choices - Save File and Save As... What file is updated if I choose Save File?

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Thu Apr 22, 2004 7:35 am

jsynoski wrote: When I right-click in the Merge Results area I get 2 choices - Save File and Save As... What file is updated if I choose Save File?
If you save the middle pane, it overwrites the working file (and hence, becomes your working file). At that point, the file is merged, except for any conflicts.

In general, if you do have conflicts, it is best not to save the file as your new working file the first time you bring up the merge window, but to resolve the conflicts in your working first first, then do the merge again, and simpy choose the working file version of the lines during the merge. Then saving the file will contain all the merges, plus the resolution of the conflicts that you wanted.

Post Reply