1/*
2 *	aegis - project change supervisor
3 *	This file is in the Public Domain, 1999 Peter Miller.
4 *
5 * The fhist program was written by David I. Bell and is admirably
6 * suited to providing a history mechanism with out the "cruft" that
7 * SCCS and RCS impose.  The fhist program also comes with two other
8 * utilities, fcomp and fmerge, which use the same minimal difference
9 * algorithm.
10 *
11 * Please note that the [# edit #] feature needs to be avoided, or the
12 * -Fored_Update (-fu) flag needs to be used in addition to the
13 * -Conditional_Update (-cu) flag, otherwise updates will complain that
14 * "Input file XXX contains edit A instead of B for module YYY"
15 *
16 * The history_create_command and the history_put_command are
17 * intentionally identical.  This minimizes problems when using
18 * branches.
19 *
20 * The ${quote ...} construct is used to quote filenames which contain
21 * shell special characters.  A minimum of quoting is performed, so if
22 * the filenames do not contain shell special characters, no quotes will
23 * be used.
24 */
25
26/*
27 * This command is used to create a new project history.  The command is
28 * always executed as the project owner.  Note he the source is left in
29 * the baseline.  The following substitutions are available:
30 *
31 * ${Input}
32 *	absolute path of the source file
33 * ${History}
34 *	absolute path of the history file
35 *
36 * The history_create_command and the history_put_command are
37 * intentionally identical.  This minimizes problems when using
38 * branches.
39 */
40history_create_command =
41	"fhist ${quote ${basename $history}} -create -cu -i ${quote $input} "
42	"-p ${quote ${dirname $history}} -r";
43
44/*
45 * This command is used to get a specific edit back from history.  The
46 * command may be executed by developers.  The following substitutions
47 * are available:
48 *
49 * ${History}
50 *	absolute path of the history file
51 * ${Edit}
52 *	edit number, as given by history_query_command
53 * ${Output}
54 *	absolute path of the destination file
55 *
56 * Note that the destination filename will never look anything like the
57 * history source filename, so the -p is essential.
58 */
59history_get_command =
60	"fhist ${quote ${basename $history}} -e ${quote $e} "
61	"-o ${quote $output} -p ${quote ${dirname $history}}";
62
63/*
64 * This command is used to add a new "top-most" entry to the history
65 * file.  This command is always executed as the project owner.  Note
66 * that the source file is left in the baseline.  The following
67 * substitutions are available:
68 *
69 * ${Input}
70 *	absolute path of source file
71 * ${History}
72 *	absolute path of history file
73 *
74 * The history_create_command and the history_put_command are
75 * intentionally identical.  This minimizes problems when using
76 * branches.
77 */
78history_put_command =
79	"fhist ${quote ${basename $history}} -create -cu -i ${quote $input} "
80	"-p ${quote ${dirname $history}} -r";
81
82/*
83 * This command is used to query what the history mechanism calls the
84 * "top-most" edit of a history file.  The result may be any arbitrary
85 * string, it need not be anything like a number, just so long as it
86 * uniquely identifies the edit for use by the history_get_command at a
87 * later date.  The edit number is to be printed on the standard output.
88 * This command may be executed by developers.  The following
89 * substitutions are available:
90 *
91 * ${History}
92 *	absolute path of the history file
93 */
94history_query_command =
95	"fhist ${quote ${basename $history}} -l 0 "
96	"-p ${quote ${dirname $history}} -q";
97
98/*
99 * Compare two files using fcomp.  The -w option produces an output of
100 * the entire file, with insertions an deletions marked by "change bars"
101 * in the left margin.  This is superior to context difference, as it
102 * shows the entire file as context.  The -s option could be added to
103 * compare runs of white space as equal.
104 *
105 * This command is used by aed(1) to produce a difference listing when
106 * file in the development directory was originally copied from the
107 * current version in the baseline.
108 *
109 * All of the command substitutions described in aesub(5) are available.
110 * In addition, the following substitutions are also available:
111 *
112 * ${ORiginal}
113 *	The absolute path name of a file containing the version
114 *	originally copied.  Usually in the baseline.
115 * ${Input}
116 *	The absolute path name of the edited version of the file.
117 *	Usually in the development directory.
118 * ${Output}
119 *	The absolute path name of the file in which to write the
120 *	difference listing.  Usually in the development directory.
121 *
122 * An exit status of 0 means successful, even of the files differ (and
123 * they usually do).  An exit status which is non-zero means something
124 * is wrong.
125 *
126 * The non-zero exit status may be used to overload this command with
127 * extra tests, such as line length limits.  The difference files must
128 * be produced in addition to these extra tests.
129 */
130diff_command =
131	"fcomp -w ${quote $original} ${quote $input} -o ${quote $output}";
132
133/*
134 * Compare three files using fmerge.  Conflicts are marked in the
135 * output.
136 *
137 * This command is used by aed(1) to produce a difference listing when a
138 * file in the development directory is out of date compared to the
139 * current version in the baseline.
140 *
141 * All of the command substitutions described in aesub(5) are available.
142 * In addition, the following substitutions are also available:
143 *
144 * ${ORiginal}
145 *	The absolute path name of a file containing the common ancestor
146 *	version of ${MostRecent} and {$Input}.  Usually the version
147 *	originally copied into the change.  Usually in a temporary file.
148 * ${Most_Recent}
149 *	The absolute path name of a file containing the most recent
150 *	version.  Usually in the baseline.
151 * ${Input}
152 *	The absolute path name of the edited version of the file.
153 *	Usually in the development directory.
154 * ${Output}
155 *	The absolute path name of the file in which to write the
156 *	difference listing.  Usually in the development directory.
157 *
158 * An exit status of 0 means successful, even of the files differ (and
159 * they usually do).  An exit status which is non-zero means something
160 * is wrong.
161 */
162merge_command =
163	"fmerge ${quote $original} ${quote $MostRecent} ${quote $input} "
164	"-o ${quote $output} -c /dev/null";
165