Skip to content
pb-diff Help

Pair renamed objects

Rows in a Compare Summary are matched by name, so an object that was renamed between the two versions shows up as a deletion and an unrelated addition. This page explains how to tell pb-diff that those two rows are the same object.

Why pb-diff does not guess

Renames are not recorded in an export file or in a library, and guessing them from content similarity produces confident wrong answers: a copied-and-edited window looks exactly like a renamed one. pb-diff therefore never invents a rename pairing. You make it, and it is applied to that compare only until you save the selection; nothing in the compared files or libraries is touched.

Pair two rows

  1. Click the Deleted row.
  2. Click the New row; the first row stays selected, without a modifier key. Either order works.
  3. Choose Compare ▸ Pair as Rename, or its labelled button in the tool bar.

The command is enabled only for exactly one Deleted row and one New row. Their states decide which is Old and which is New, so click order cannot reverse the comparison or pair one side of an already modified row by mistake.

The pair is compared on its own, by whatever Object compare type the rest of the summary used, and the two rows are replaced by one carrying the result: Renamed, unchanged if the two are the same object under two names, Renamed, modified if they also differ. The row shows both names, and the status bar says which two rows became which one. Double-click it to open the detailed File Compare for the pair.

Remove a pairing

Select the renamed row and choose Compare ▸ Remove Rename Pairing, or its labelled tool-bar button. The combined row is removed and the original Deleted and New rows return. Refresh keeps the pairings you have not removed, and saving the selection with File ▸ Save keeps the ones that remain.

Try it

Compare rename/old/orders.pbl with rename/new/orders.pbl, two versions of the Order Desk library (see The Order Desk examples), and switch off Only Changed Items. Among the unchanged objects, the summary shows n_tax.sru as Deleted and n_tax_calculator.sru as New.

pb-diff Compare Summary of two versions of the orders.pbl library in which n_tax was renamed to n_tax_calculator and changed: the grid lists the unchanged objects, n_tax as a deleted row and n_tax_calculator as a new row.
pb-diff does not guess renames: in two versions of orders.pbl, n_tax and n_tax_calculator are listed as one deleted and one new object among the unchanged ones. Select the image to view it at full size.

Select those two rows and choose Pair as Rename. They become one Renamed, modified row: the object was renamed, and it also gained a French tax rate. Double-click it, and the changed function is the only thing the detailed compare shows, instead of one whole object deleted and one whole object added. Save the selection to keep the pairing; the saved selection carries it.

pb-diff Compare Summary of the same two libraries after the two rows were paired by hand: one row shows n_tax renamed to n_tax_calculator with the renamed and modified status, among the unchanged objects.
After pairing the two rows, they become one renamed and modified object, and the pairing is saved with the selection. Select the image to view it at full size.

The CLI takes the pairing as an argument instead of a click, repeatable for as many renames as you have. Both commands return exit code 1, but the entry statuses differ (unpaired, paired):

pb-diff-cli compare-lib rename/old/orders.pbl rename/new/orders.pbl --format json
pb-diff-cli compare-lib rename/old/orders.pbl rename/new/orders.pbl --pair n_tax.sru=n_tax_calculator.sru --format json