/*
 *	aegis - project change supervisor
 *	This file is in the Public Domain, 1995, 1998, 2001 Peter Miller.
 *
 * The entries for the commands are listed below.  SCCS uses a slightly
 * different model than aegis wants, so some maneuvering is required.  The
 * command strings in this section assume that the SCCS commands admin and get
 * and delta are in the command search PATH, but you may like to hard-wire the
 * paths, or set PATH at the start of each.  You should also note that the
 * strings are always handed to the Bourne shell to be executed, and are set to
 * exit with an error immediately a sub-command fails.
 *
 * The ${quote ...} construct is used to quote filenames which contain
 * shell special characters.  A minimum of quoting is performed, so if
 * the filenames do not contain shell special characters, no quotes will
 * be used.
 *
 *	NOTE:  NOTE:  NOTE:  NOTE:  NOTE:  NOTE:  NOTE:  NOTE:	NOTE:
 *	I only ever tried this stuff using GNU CSSC.  I have no idea
 *	whether it works with any other SCCS implementation.
 */

/*
 * This command is used to create a new project history.
 * The command is always executed as the project owner.
 * The following substitutions are available:
 *
 * ${Input}
 *	absolute path of the source file
 * ${History}
 *	absolute path of the history file
 *
 * This assumes that the ae-sccs-put script is in the $PATH.  The history
 * file is created of it does not exist.  The file is left in the
 * "not editing state".  The original source ($input) file is left in
 * the baseline.
 *
 * It is essential that the history_put_command be identical to the
 * the history_create_command for branching to work correctly.
 */
history_create_command =
	"ae-sccs-put -s -y${quote ($version) ${change description}} "
	"-G${quote $input} ${quote ${dirname $history}/s.${basename $history}}";

/*
 * This command is used to get a specific edit back from history.
 * The command may be executed by developers.
 * The following substitutions are available:
 *
 * ${History}
 *	absolute path of the history file
 * ${Edit}
 *	edit number, as given by history_query_command
 * ${Output}
 *	absolute path of the destination file
 *
 * get -r<rid>	edit number
 * get -s	silent
 * get -p	use stdout
 * get -k	suppress keywords
 */
history_get_command =
	"sccs get -r${quote $edit} -s -k -G${quote $output} "
	"${quote ${dirname $history}/s.${basename $history}}";

/*
 * This command is used to add a new "top-most" entry to the history file.
 * This command is always executed as the project owner.
 * The following substitutions are available:
 *
 * ${Input}
 *	absolute path of source file
 * ${History}
 *	absolute path of history file
 *
 * This assumes that the ae-sccs-put script is in the $PATH.  The history
 * file is created of it does not exist.  The file is left in the
 * "not editing state".  The original source ($input) file is left in
 * the baseline.
 *
 * It is essential that the history_put_command be identical to the
 * the history_create_command for branching to work correctly.
 */
history_put_command =
	"ae-sccs-put -s -y${quote ($version) ${change description}} "
	"-G${quote $input} ${quote ${dirname $history}/s.${basename $history}}";

/*
 * This command is used to query what the history mechanism calls the top-most
 * edit of a history file.  The result may be any arbitrary string, it need not
 * be anything like a number, just so long as it uniquely identifies the edit
 * for use by the history_get_command at a later date.  The edit number is to
 * be printed on the standard output.  This command may be executed by
 * developers.  The following substitutions are available:
 *
 * ${History}
 *	absolute path of the history file
 *
 * Note that "get" reports the edit number on stderr.
 *
 * get -g	no input
 * get -t	include branches
 */
history_query_command =
	"sccs get -t -g ${quote ${dirname $history}/s.${basename $history}} "
	"2> /dev/null";
