Nydiff compares two different evolutionary stages of the same Pam file and delivers the differences found as a cradle which can be used to update the earlier stage to the later stage. This allows to collate the updates from parallel developments started from the same original Pam file.
Beyond the normal operations of changing the contents of decks, of deleting patches or decks, and of adding new patches or decks, the user is supposed to be also free to some extent to change the names of patches and decks, and to re-arrange the order of the patches on their Pam file, or of the decks within their patch.
Although it would always be possible to make a cradle to update even two unrelated files, to be useful when comparing several parallel evolutions of the same Pam file it is essential to minimize the volume of the cradle, which means that Nydiff has to do its best to determine which deck on "old" is at the origin of which deck on "new".
To do this Nydiff operates in the following stages:
On the result of the matching process the cradle is built:
patches or decks of "old" not found on "new" are deleted with
+USE, T=INH
, patches or decks on "new" not found on "old" are
added with +ADD
. For related decks the differences of content
are recorded with +ADD
, +REPLACE
, or +DELETE
.
Since re-ordering the material of a Pam file cannot be done with Nypatchy if one also wants to have a minimal cradle, the instructions to re-order are delivered as an Exec-file for the Wylbur editor.
The program call for Nydiff is:
nydiff old.car new.car diff.ucra options print old is the reference Pam file from which new has been derived; diff.ucra is the cradle for Nypatchy delivered to update the decks on "old" to become "new", diff.uexe is the Exec file for Wylbur to re-order the file; options: A (anyway) by-pass the intial test to see whether 3/4 of the patches have been identified between "old" and "new", F (force) by-pass also the later test to see whether 3/4 of the decks have been identified by name or by content between "old" and "new" print is the printed output, stdout by default.
If one has the reference Pam file old.car
, say, and one receives
the result from Nydiff in the form of the two cradles diff.ucra
and diff.uexe
, one can make new.car
with this shell script:
nypatchy - new.car .go <</ +UPDATE. +LIST, UPD. if one wants to see the corrections in context +USE, T=EXE. +PAM, T=ATTACH .diff.ucra +PAM, T=ATT, UPDATE .old.car +QUIT. / useb new.car <</ @diff.uexe save,unn,replace quit /The correction cradle diff.ucra comes in fact in the form of a Pam file; all corrections are headed with
+PATCH,UPD.
"useb" calls a version of Wylbur which can handle a file of up to 120 000 lines; the normal version of Wylbur, called with "use" can handle 60000 lines.