MAINSAIL Utilities User's Guide, Chapter 13

previous   next   top   contents   index   framed top   this page unframed


13. FILMRG, File Merging Utility

Command line syntax: filmrg {baseFile {file1 {file2 {outputFile}}}}*

FILMRG takes as input an original file (the “base file”) and two files (the “edited files”) that may have differences from the base file. FILMRG produces as output a merged file composed of the base file modified to incorporate the differences from both of the edited files, and also a difference file displaying the differences among the files. FILMRG is useful for developing a composite version of a file from two files that have undergone separate editing paths from a common starting point.

User interaction with FILMRG is similar to user interaction with LINCOM (see the description of LINCOM in Chapter 20).

FILMRG prompts for the names of the base file, the first edited file, and the (optional) second edited file (if the second file is omitted, it is treated more or less like an empty file). FILMRG then prompts with Subcommands? (Yes or eol). If Y (or y) is typed in response to this prompt, FILMRG allows you to set various options that control the comparison of the input files. The prompts displayed when the options are set are shown in Example 13–1. FILMRG then determines whether there are any differences among the files. If there are any, then FILMRG asks for the name of the merged (output) file; otherwise, FILMRG reports that the files are identical.

Example 13–1. Prompts for FILMRG Options
Show differences? (eol or No):
The following three prompts are suppressed if you answer no to the
previous prompt:

Name of output file for differences (eol for logFile):
Automatic continuation? (Yes or eol):
Max display lines (eol for 23):
Nonblank lines to match (eol for 5):

The Name of output file for differences, Automatic continuation, Max display lines, and Nonblank lines to match subcommands have the same meaning as for LINCOM.

If the output file for differences is the default (logFile), the interactive display of differences is somewhat different from LINCOM's. If the number of lines for one of the differences exceeds the maximum allowed, FILMRG prompts whether to display more lines for the same file before displaying lines from the corresponding difference in the next file.

If a difference consists of an insertion in the base file, the line <insertion> is shown for the difference in the base file; if a difference consists of a deletion from the base file, the line <deletion> is shown for the difference in the base file. If both edited files' lines are the same in a given difference, the second edited file's difference is shown as the line <same>.

The merged file contains the differences from both of the edited files. If the differences from the base file are the same in both edited files, the affected section of the base file is replaced in the merged file by the corresponding section of the edited files. Wherever the two edited files do not contain the same difference from the base file, the affected sections from each of the three files are included in the merged file in the format:

*********************** baseFileName ***********************
sectionFromBaseFile
******************* 
firstEditedFileName *******************
sectionFromFirstEditedFile
****************** 
secondEditedFileName *******************
sectionFromSecondEditedFile
***************************** 
end ******************************

Each such conflicting section requires you to edit the merged file in order to produce a version of the file that resolves the conflict. FILMRG reports the number of conflicting sections at the end of each merge.

An example of FILMRG execution is shown in Example 13–2. One of the conflicting sections from the merged file newUnix.msl is shown in Example 13–3.

Example 13–2. FILMRG Example
Original file/oldxxsrc/unix.msl<eol>
First edited file/xxsrc/unix.msl<eol>
Second edited file (<eolif none): /yyysrc/unix.msl<eol>
Subcommands? (Yes or eol): y<eol>
Show differences? (eol or No): n<eol>
Nonblank lines to match (eol for 5): <eol>
Name for merged file (<eolfor none): newUnix.msl<eol>
12 
conflicting changes need editing in output file

Merge more files? (Yes or eol): <eol>

Example 13–3. A Sample Conflicting Section from the Merged File
******************* /oldxxsrc/unix.msl *******************
"
Desired module OSDTAPUNISYSBSDITFS5ITF "
    & "(
in quotes)" & eol &
    "(
UNISYSBSDITFand S5ITF are foreign modules): ";
******************** /
xxsrc/unix.msl ********************
"
Desired moduleOSDTAPUNISYSBSDITFS5ITFMVUX "
    & "(
in quotes)" & eol &
    "(
UNISYSBSDITFS5ITFand MVUX " &
    "
are foreign modules): ";
******************** /
yyysrc/unix.msl ********************
"
Desired module (in quotes).  Choices are:" & eol &
"
BSDITFBSDTCPMVUXOSDTAPS5ITFUNISYS" & eol &
"(
BSDITFBSDTCPMVUXS5ITFand UNISYS " &
    "
are foreign modules)" & eol;
************************** 
end **************************


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Utilities User's Guide, Chapter 13