1/* 2 * aegis - project change supervisor 3 * This file is in the Public Domain, 1999 Peter Miller. 4 * 5 * The diff3(1) command is the oldest of the Unix file merge tools, and 6 * the least capable. You should use the RCS merge(1) in preference to 7 * diff(3). 8 */ 9 10 11/* 12 * Compare three files using diff3. Conflicts are marked in the 13 * output. 14 * 15 * This command is used by aed(1) to produce a difference listing when a 16 * file in the development directory is out of date compared to the 17 * current version in the baseline. 18 * 19 * All of the command substitutions described in aesub(5) are available. 20 * In addition, the following substitutions are also available: 21 * 22 * ${ORiginal} 23 * The absolute path name of a file containing the common ancestor 24 * version of ${MostRecent} and {$Input}. Usually the version 25 * originally copied into the change. Usually in a temporary file. 26 * ${Most_Recent} 27 * The absolute path name of a file containing the most recent 28 * version. Usually in the baseline. 29 * ${Input} 30 * The absolute path name of the edited version of the file. 31 * Usually in the development directory. 32 * ${Output} 33 * The absolute path name of the file in which to write the 34 * difference listing. Usually in the development directory. 35 * 36 * An exit status of 0 means successful, even of the files differ (and 37 * they usually do). An exit status which is non-zero means something 38 * is wrong. 39 * 40 * The diff3(1) man page documents the file order as "mine, older, 41 * yours". The diff3 -e option says to write output which can be used 42 * as ed(1) input. 43 */ 44merge_command = 45 "(diff3 -e ${quote $i} ${quote $orig} ${quote $mr} | " 46 "sed -e '/^w$$/d' -e '/^q$$/d'; echo '1,$$p' ) | " 47 "ed - ${quote $i} > ${quote $out}" 48 ; 49