Home     Contact Us     SoftLanding Europe     Deutsch     Español

The Software Management Experts

    December 2006  Volume 10, Number 4              

Merging Source with TurnOver

By Joe Baumgarten, Sales Engineer

I’ve been teaching my five-year-old son various card games lately and he is absolutely fascinated by my ability to break the deck into two halves and shuffle them together. (I know, I know, enjoy it while it lasts, right?)

When I demonstrate TurnOver’s Synchronizer merge tool, I often use the analogy of shuffling a deck of cards. Most people can get their heads around comparing and merging two source members, but the real trick is when you need to merge code from three sources. (Try that with a deck of cards.)

Merging code from three members is exactly what is called for when you are trying to fold together the latest software release from a vendor with the custom modifications your shop has made to it over the years. (See the companion article in this issue on TurnOver’s Synchronizer tool for more information on this process.)

When last we left our vendor synchronization project, the project manager had built a most useful impact analysis file that highlighted all the changes between our custom mods to Release 1, Release 1 itself, and the new enhancements coming in Release 2. He grouped all of the entries from the file into tasks, assigned them to programmers, and built the programmer worklists. The programmer on the receiving end now has a task and a populated worklist. Time to get started!

The free TurnOver plug-ins for WDSC provide many great features that programmers will appreciate as they work on this task1. As the figure below shows, they can easily browse any of the three versions of source, compare any two of the versions, jump to the associated worklist, or perform the three way merge.

figure1
Figure 1: Help menu contents for the Eclipse-based WDSC (left) and TurnOver clients

As you can see, we have actually incorporated the Eclipse-provided three way merging tool into TurnOver. This is the same tool that PC developers use when comparing multiple versions of Java code, for example. It also works extremely well with all text-based source, such as RPG, DSPF, CLP, and so on.

figure2
Figure 2: Merge Source Members

When you select the Eclipse merge, you will be prompted for the proper “order” of the three members you wish to merge.

Think of the “reference member” as the place from which both of the other two versions started. In our Synchronizer example, this would be Release 1 -- what the Impact Analysis called the "Old Base." Next, you have to decide which of the remaining two versions should be most important to you. Most often you’ll say that your custom mods will be “primary” and will be preferred over the Release 2 from the vendor, which falls to the “secondary” category. Finally, you will tell the tool where you would like to perform development work on the code as you merge it. As you can see from the screen shot above, when you select the Eclipse Merge function, Synchronizer defaults with these settings already selected. Furthermore, it knows the locations of each source member from the impact analysis entry.


When you click OK, a screen something like this appears:

figure3
Figure 3: Fully functional search engine for online Help

The top pane represents Release 1, which is our reference, or “base” code. In other words, the code from which both other versions originated. The bottom left pane is our custom mods, the “primary” source. Because we told the tool to replace the existing development member, the primary source code has been copied wholesale into the development member. This makes sense because we said, basically, “These changes I’ll keep more often than not.” By the way, this is the only panel where we can make source code changes and save them. The pane on the bottom right is the secondary member, Release 2.

At this point, my friend, you need your brain. Some lines are new and could be easily pulled straight over (Line 8, for example). Some lines were not changed in either your custom mods or Release 1, but did change in Release 2 (Line 4). The most difficult ones will be those that have changed in all three versions (Line 2).

Once you decide to pull a line over, you click on the box in the middle of the line connecting the two versions and, voila! Your code segment copies from right to left. Of course, you can still edit on the left side after the copy, which is the beauty of doing this in WDSC!

When you are done editing, close the window and save your code. By default, it is saved in the development library that TurnOver has specified in your application definition. This means that you can switch over to your worklist at any point and continue the remainder of your development, compiling, building forms, running forms, etc. In other words, it is classic TurnOver Change Management!

By the way, a three-way merge also comes in handy when two developers have made concurrent changes to the same original source member. So if you find yourself wanting to leverage this powerful merge tool outside the context of Synchronizer, you'll want to check out the Source Compare and Merge plug-in that's included with SofLanding's no-cost RSE Extensions for WDSC. For a quick tutorial, read the RSE Extensions Compare/Merge article included in this issue.

1Because the TurnOver Client is not a full IDE, functions like browse, edit, compare source, and merge source are not available there.

WHAT'S NEW
Sign Up Now to Receive The Landing Zone eNewsletter
| more