[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
get
The get
command is to retrieve previous revisions from an
SCCS file. With the ‘-e’ option, it also locks the gotten
revision so that a modified version can be checked in later using
delta
.
3.5.1 Basic Usage for get | Frequently-used get commands
| |
3.5.2 Options for get | Full list of options. | |
3.5.3 Making Branches | How branches are made. | |
3.5.4 Keyword Substitution | ||
3.6 Included Excluded and Ignored deltas | Here Be Dragons... |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
get
There are very few common basic usage patterns for get
. Below,
‘s.foo.c’ denotes the name of any existing SCCS file.
Get a copy of the most recent trunk revision of ‘s.foo.c’ into the file ‘foo.c’.
Get a version from ‘s.foo.c’, into ‘bar’ rather than the
default ‘foo.c’. The file produced by get
is often referred
to as the “g-file”.
Get revision 1.3 from ‘s.foo.c’ into ‘foo.c’. The ‘-G’ option can be used to set the name of the gotten file.
Get the most recent trunk revision, and print it on standard output. The ‘-r’ option could also be used to specify some other revision.
Unless you specify the ‘-k’ or ‘-e’ option, the retrieved file will be created read-only.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
get
Full description of options
Retrieve the version corresponding to the delta sequence number N. Mainly for use by other programs in the suite.
Create a new branch when the resulting file is checked back in. Used with the ‘-e’ option. If the ‘-e’ option is not given, or if the ‘b’ (branch) flag is not set in the SCCS file, this option has no effect; a branch is not made. If the version to be checked out for editing has a successor, a branch is created whether or not the ‘-b’ flag is present (see section Making Branches).
Get the version that was current at the time specified by when. The
format of the argument is [cc]yy[mm[dd[hh[mm[ss]]]]]. Any fields
omitted (except “cc”) assume their maximum possible values so that if
you specify ‘-c92’, you get the latest version which was available
in the year 1992. It is possible to give four digits for the year as a
CSSC-specific extension, but only if none of the other fields are
omitted. If only two digits are used and the resulting value is less
than 69, the year is assumed to be in the twenty-first century
(see section Options for prs
and Year 2000 Issues).
Turns on debugging output, indicating what is going on as the SCCS file is read. This option may go away or have its behaviour change in the near future.
Indicates that the retrieved version is for editing. When checked
back in the resulting file will have a new revision number. The
retrieved file is writable, and keyword substitution does not take
place. A p-file is created; this file contains information
about what versions of the s-file are being edited, and by whom.
Unless the ‘j’ flag is set (see section Flags), get -e
will
fail if someone else already has the file locked. If the list of
authorised users in the SCCS file is not empty, you must be in
that list in order to use this option.
Do a dry-run, showing what version would be retrieved, but don’t actually get the file. This is sometimes done by scripts, just to test the exit status.
Name the gotten file ‘foo’, instead of the default name.
Include the deltas for the listed SIDs. See also ‘-x’.
Avoid doing keyword substitution (see section Keyword Substitution). This is assumed when ‘-e’ is specified. The gotten file is writable.
Generates a delta summary file in the current working directory. The
name of the file is ‘l.foo’ where ‘foo’ is the name that
would normally be used for the gotten file. The name of the delta
summary file is not affected by the ‘-G’ option. The delta
summary file is similar in content to the output of prt
, though
it contains less information.
This is obsolete; use ‘-L’ instead.
Generate a delta summary as for the ‘-l’ option, but print it on stdout instead of creating a file. If ‘-L’ and ‘-p’ are both specified, the delta summary is printed first.
Prepend to each line of the result the SID corresponding to the
delta
which introduced this line to the file.
Precede each line of output with the module name, before any SID added with the ‘-m’ option.
Write the result to the standard output, rather than to a file.
Retrieve version X, rather than the default.
Run silently.
Get the “top” delta for the indicated release. The default behaviour
of get
is to get the highest revision on the trunk. The
‘-t’ option only modifies this behaviour in the situation where the
topmost trunk revision is a branch point. In this case, the ‘-t’
option causes the topmost revision on this branch to be retrieved. In
other words, the ‘-t’ option removes the restriction that the
retrieved version should be on the trunk. This option is used by
comb
(see section comb
) and by the driver program sccs
from
BSD (see section sccs
).
Show version information.
When performing keyword substitution (see section Keyword Substitution), use XXX rather than ‘%Z%%M% <TAB> %I%’ as the substitution value for %W%.
Exclude the indicated deltas from the result. Deltas are indicated by specifying the SID at which they arrived in the file.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Normally, editing revision 1.1 of a file produces revision 1.2. Editing that produces revision 1.3, and so on. Sometimes, however, we need to make a change to an earlier version which has already been superseded.
This might happen, for example, when a bug has been reported in a released version of a file; a rapid bug-fix is required, but you’re in the middle of working towards a new release. A viable strategy is to make a branch at the previously-released version, modify that to fix the bug (and release this bug-fix). Meanwhile, development can be continued along the “main trunk”, and the same bug-fix can be incorporated in this, ready for the next release later on.
When you check out a version of a file for editing, CSSC tells you
what the SID of the new version will be. For normal progress along
the trunk, the level number is incremented. This is the second
numeric element of the SID. In general, a SID is composed of
four numbers ‘R.L.B.S’, where “R” stands for “Release”, “L”
stands for “Level”, “B” stands for “Branch”, and “S” stands for
“Sequence number” (not the same as the sequence numbers produced in
the output of prt
).
Trunk revisions have only two components; you can think of the branch and sequence numbers as being zero. Non-trunk revisions have four components. When a branch is created from an existing SID, the release and level numbers are copied, the branch number is set to the lowest unused value for that release and level, and the sequence number is set to one. Hence the first branch from version 1.1 will be version 1.1.1.1, and if a branch is made from that, its SID will be 1.1.2.1.
Branches are made from any given version when that version already has a
successor. For example, a get -e
on version 1.1 will result in a
branch (1.1.1.1) if version 1.2 exists, and a get -e
on version
1.2.1.1 will result in a branch (1.2.2.1) if version 1.2.1.2 exists.
If the “enable branches” flag is set, it is also possible to make
branches for revisions that do not have successors. This is done with
the ‘-b’ flag of get
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Keyword substitution is performed unless the ‘-k’ option or the
‘-e’ option is given to get
.
what
contains a keyword substitution example.
The keywords are all of the form ‘%x%’ where x stands for an upper-case letter, one of:
Expands to the same as ‘%Z% %Y% %M% %I% %Z%’.
The branch number of the gotten version
Current line in the output file
The date at the time the file was gotten, in the form yy/mm/dd. The year is always represented as two digits but this is not ambiguous since the two-digit year is no later than 2068 (see section Year 2000 Issues).
The date that the newest delta in the gotten file was applied, yy/mm/dd. The year is always represented as two digits but this is not ambiguous since the two-digit year is no later than 2068 (see section Year 2000 Issues).
Name of the SCCS file, for example ‘s.foo.c’.
As for %E%, but in the US format mm/dd/yy.
As for %D%, but in the US format mm/dd/yy.
Expands to the same as %R%.%L%.%B%.%S%, that is, the SID of the retrieved version.
The level number of the retrieved version.
Module name: the value of the m
(module) flag, or the base name
of the SCCS file with the ‘s.’ removed if the module flag is
unset.
Full name of the SCCS file.
Value of the q
flag. The q
flag has no other purpose, and
can be set with ‘admin -fqfoo’. See section Flags.
Release number of the retrieved version.
Sequence number of the retrieved version.
Current time (hh:mm:ss) when the file was retrieved, see %D% and %H%.
Expands to %Z% %M% <TAB> %I% or the argument for the ‘-w’ flag, if given.
Value of the t
(module type) flag.
The literal string @(#)
. See section what
.
Some of the keywords listed above have expansions that are described in terms of the contents of other keywords. This expansion is performed as if the ‘y’ flag in the SCCS file is not set. For example, ‘admin -fyA’ will cause the ‘%I%’ keyword not to be expanded, but the ‘%A%’ keyword is still fully expanded, even though it is defined in terms of ‘%I%’.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by buildd user on December 8, 2011 using texi2html 1.82.