The new Patchy auxiliary Nydiff



next up previous
Next: Example Up: Release of Patchy version Previous: Patchy 5 on

The new Patchy auxiliary Nydiff

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:

1)
the number of Pam files must be the same on "old" and "new", their order is assumed not to have changed, but the Pam file identifiers may have changed; migration of material from one Pam file to another one is assumed not to occur.

2)
matching by name assumes that patches of the same name on "old" and "new" are related, and also decks of the same name in related patches. At the end of this process there is a test (which can be bypassed with the A option): unless 3/4 of the patches have been matched by name the error exit is taken.

3)
matching of patches by content compares all as-yet unmatched patches on "old" against all unmatched patches on "new" (of the same Pam file): if either 3/4 of the deck names or 80 per-cent of the content are the same the two matching patches are assumed to be related.

4)
matching of decks by content compares all as-yet unmatched decks of each patch on "old" against all unmatched decks in the related patch on "new": if the contents of two decks are the same to 80 per-cent they are supposed to be related. At the end of this process there is a second test (which can be by-passed with the F option): unless 3/4 of all decks have been matched the error exit is taken.

5)
to find "lost" decks which may have been tranfered from one patch to an other one, Nydiff takes each unmatched deck on "old" (of a non-deleted patch) and scans the patches on "new" to compare unmatched decks by name and by content: if the name is the same and the content the same to the 80 per-cent level the deck is pulled from its "old" patch.

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.




next up previous
Next: Example Up: Release of Patchy version Previous: Patchy 5 on


@Thu Oct 6 15:53:34 MET 1994