It's all about the answers!

Ask a question

How to compare and merge files across stream?


Pravin Patil (104119119) | asked Jun 18 '15, 5:17 p.m.

I have a streamA with ComponentA. ComponentA has fileA and FolderA.

On my local system I have fileA, and FolderA but with different content.

I want to merge these files together and also report the changes between them, then resolve the conflicts and  merge. This example is of one file, but I have 100+ files coming from different project which I need to merge in my stream. Hence getting the report on differences and then resolving conflict is important.

What I did:

Created a new streamB, added the ComponentA from streamA to it. Imported fileA and FolderA from local drive into streamB>ComponentA. Checkedin and delivered to streamB.

Changed the flow target of streamA to StreamB (set it to current). I see the changes from streamB incoming to streamA. Now when I accept these changes and since fileA has differences, it should have given me a conflict but it didn't. It simply accepted the changes.

What is the right way to do?

Also how to get the differences? I tried compare baselines, but it didn't show the differences in FileA .

Please suggest.


Comments
Geoffrey Clemm commented Jun 20 '15, 5:27 p.m. | edited Jun 20 '15, 5:30 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Just to confirm, I assume you are using RTC for your work, while the "different project" is not using RTC (if they were using RTC, everything would be automated, and it would act the way you would expect).

3 answers



permanent link
Lily Wang (4.9k714) | answered Jun 19 '15, 1:57 a.m.
 If you check from fileA history from stream B, you will find the change set of stream A is the predecessor version of the change set on stream B. So when you deliver the change set from stream B back to stream A, no conflict is reported.

To achieve your object, you may need:
1. On stream A, create component A. Check-in all the files. The file content should be empty.
2. Create stream B by adding component A from stream A.
3. On Stream A, overwrite the files with one of you local version. Check-in and Deliver.
4. On Stream B, overwrite the files with the other content of you local version. Check-in and Deliver.
5. Do merge between Stream A and Stream B. You will see merge and conflict happened.

Comments
Geoffrey Clemm commented Jun 20 '15, 5:32 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note that "do merge between Stream A and Stream B" means to either merge from Stream B to Stream A, or merge to some third stream, such as "Stream AB".   Stream B should be reserved for receiving incoming work from the other team ... i.e. the next time the other team has changes, copy those changes onto a sandbox that is loaded from a workspace for Stream B, and then checkin those changes.


permanent link
Ralph Schoon (61.1k33643) | answered Jun 19 '15, 2:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 
Since you simply imported the same file into the component, you don't have a common ancestor and thus, as far as I can tell the files are not recognized to be the same. I am not sure if the tool can show anything other than that you would overwrite the file.

In a normal scenario, you start from a stream e.g create a repository workspace from stream A load it and do changes.

You create a repository workspace from stream B, which might be created from a baseline on stream A, and you load it and do changes. 

You then change the flow target to the other stream and you get the differences going in and out and, more importantly, the deltas of the changes done to the files. 

Comments
Pravin Patil commented Jun 19 '15, 2:39 p.m.

Actually, I am getting set of files (e.g. FileA) from different team. I need to merge these files with StreamA managed by me. These are common files across 2 projects, but they are treated differently. My project has to be on same changes as the other project. Hence I have to import them > identify what is different in fileA with me and the one I received > Generate report on differences > Merge conflicts

How can this be done?


permanent link
Abraham Sweiss (2.4k1131) | answered Jun 19 '15, 4:30 p.m.
Just a thought, but could the following be tested.
1.  Have workspace A and B and Stream A and B.
2. Stream A flows into stream B.
3. At this point there are no components
4. Add the component and file into workspace A and deliver
5. Now there should be a common annsestor in all workspaces / streams
6. Add new files to workspace B.  The changes will only flow to Stream B and not A
7. make modifications to files in workspace A.  Now when delivering we would expect to see a conflict when the changes are flowing from stream A to stream B.
a. The way to resolve the conflicts is to set a flow target from workspace A to Workspace B and resolve the conflicts.

NOTE: As Ralph noted, as long as there is a common ancestor this should work.  otherwise, you will need to manually check for differences.  

Your answer


Register or to post your answer.