Your first two-way merge
A File Compare shows the differences and lets you choose between them. Old is the reference and the result starts as New, so before you decide anything File ▸ Save writes the new version back out unchanged. Compare ▸ Merge ▸ Take Old Version moves one element back towards the old version: something New deleted comes back, something it added goes away, and something it changed reverts. Take New Version abandons the decision again. How merging works describes all of it; this tutorial does it twice, on the Order Desk examples described in Your first comparison.
Restore an old function
Compare old/w_order_entry.srw with
new/w_order_entry.srw and select wf_total.
Choose Compare ▸ Merge ▸ Take Old Version, or its arrow
in the tool bar. The merge panel opens under the compare with the
release 1.4 function, the truncation and the debug message included, and
the tree marks wf_total as restored.
A tree node is a whole item. To act on one changed block instead, put the caret on a changed line of the script, by clicking it or stepping to it with Alt+↓. The Merge target line above the merge panel names what the next operation will act on, so you can check it before running it.
Choose Save and save to a separate file; neither
input is changed. This restored the whole function, not one changed
line, and nothing else: the rest of the object is still release 1.5. The
saved file
therefore differs from New in wf_total alone. The CLI
verifies the desktop application's output; it does not perform the
two-way merge (result):
pb-diff-cli compare new/w_order_entry.srw merge/w_order_entry.srw --format json
Restore a deleted control
Compare old/w_customer_lookup.srw with
new/w_customer_lookup.srw and select cb_clear
in the tree. Release 1.4 had a Clear button with a
clicked event; release 1.5 has neither.
Choose Take Old Version on the control: its property
block and its event come back. Then read the merge warnings in the
panel. The new release also removed the control's declarations, so
restore Forward Declarations and the window's
w_customer_lookup (window) type block with Take
Old Version too, and the warning about an undeclared control
disappears. pb-diff maintains the .create,
.destroy and control-list statements itself; select
.create to see this.cb_clear=create cb_clear
back in place.
Save the result. The saved
window has the button, its event and its declarations back, and
differs from release 1.4 only in the .create and
.destroy scripts: a restored control goes to the top-most
position, so it is created first and heads the control list. The CLI
shows exactly that, with exit code 1 (result):
pb-diff-cli compare old/w_customer_lookup.srw merge/w_customer_lookup.srw --format json
If the original z-order mattered, fix it in PowerBuilder.
Before you rely on it
The saved file is a PowerBuilder export, UTF-16LE with a byte-order
mark and CRLF, as the Library painter writes one; nothing is ever
written into a .pbl. Importing merged output is supported
for PowerBuilder 19 and later. pb-diff does not compile the result:
import it into a scratch target and build it before relying on it. See
How merging works.
Next
- Your first three-way merge: two developers' changes to one object.
- File Compare: the merge commands and the merge panel.