This subsection discusses:
RCS lets you place keyword variables in your working files. These variables are later expanded into revision notes. You can then use the notes either as embedded comments in the input file, or as text strings that appear when the output is printed. To create revision notes via keyword substitution, follow this procedure:
Note: In RCS Version 5, many commands have a -k option that provides more flexibility during keyword substitution.
Let's assume that the file /projects/new/chapter3 has been checked in and out by a user named daniel . Here's what keyword substitution would produce for each keyword, for the second revision of the file:
$Author: daniel $ $Date: 92/03/18 17:51:36 $ $Header: /projects/new/chapter3,v 1.2 92/03/18 17:51:36 daniel \ Exp Locker: daniel $ $Id: chapter3,v 1.2 92/03/18 17:51:36 daniel Exp Locker: daniel $ $Locker: daniel $ $Log: chapter3,v $ # Revision 1.2 92/03/18 17:51:36 daniel # Added section on error-handling # # Revision 1.1 92/03/18 16:49:59 daniel # Initial revision # $RCSfile: chapter3,v $ $Revision: 1.2 $ $Source: /projects/new/chapter3,v $ $State: Exp $
Unless told otherwise, RCS commands typically operate on the latest revision.
Some commands have a
option that is used to specify a revision number.
In addition, many options accept a revision number as an optional argument.
(In the command summary, this argument is shown as [
When you check it in again, the new revision will be marked as 1.5. But suppose the edited copy needs to be checked in as the next release. You would type:
This creates revision 2.1. You can also create a branch from an earlier revision. The following command creates revision 188.8.131.52:
Numbers are not the only way to specify revisions, though. You can assign a text label as a revision name, using the -n option of ci or rcs . You can also specify this name in any option that accepts a revision number for an argument. For example, you could check in each of your C programs, using the same label regardless of the current revision number:
In addition, RCS version 5.6 lets you specify a $, which means the revision number extracted from the keywords of a working file. For example:
compares ch01 to the revision that is checked in. You can also combine names and symbols. The command:
assigns a name to the revision numbers associated with several chapter files.
Revisions are timestamped by time and date of check in. Several keyword strings include the date in their values. Dates can be supplied in options to ci , co , and rlog . RCS uses the following date format as its default:
1995/10/16 02:00:00 (year/month/day time)
The default timezone is Greenwich Mean Time (GMT), which is also referred to as Coordinated Universal Time (UTC). Dates can be supplied in free format. This lets you specify many different styles. Here are some of the more common ones, which show the same time as in the example above:
6:00 pm lt (assuming today is Oct. 16, 1995) 2:00 AM, Oct. 16, 1995 Mon Oct 16 18:00:00 1995 LT Mon Oct 16 18:00:00 PST 1995
The uppercase or lowercase "lt" indicates local time (here, Pacific Standard Time). The third line shows ctime format (plus the "LT"); the fourth line is the date command format.
In some situations, particularly programming environments,
you want to know the status of a set of revisions.
RCS files are marked by a text string that describes their
RCS Version 5.6 defines an environment variable RCSINIT, which is used to set up default options for RCS commands. If you set RCSINIT to a space-separated list of options, they will be prepended to the command-line options you supply to any RCS command. Three options are useful to include in RCSINIT: -q , -V , and -x . They can be thought of as standard options because most RCS commands accept them. Note that -V is new in RCS Version 5 and that -x is new in Version 5.6.
For example, when depositing a working file into an RCS file, the command:
searches in order for the RCS filenames:
RCS/ch01,v ch01,v RCS/ch01