[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5 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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5.1 Basic Usage for get

There are very few common basic usage patterns for get. Below, `s.foo.c' denotes the name of any existing SCCS file.

`get s.foo.c'

Get a copy of the most recent trunk revision of `s.foo.c' into the file `foo.c'.

`get -Gbar s.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 -r1.3 s.foo.c'

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 -p s.foo.c'

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] [ ? ]

3.5.2 Options for get

Full description of options

`-aN'

Retrieve the version corresponding to the delta sequence number N. Mainly for use by other programs in the suite.

`-b'

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).

`-cwhen'

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).

`-D'

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.

`-e'

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.

`-g'

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.

`-Gfoo'

Name the gotten file `foo', instead of the default name.

`-ilist'

Include the deltas for the listed SIDs. See also `-x'.

`-k'

Avoid doing keyword substitution (see section Keyword Substitution). This is assumed when `-e' is specified. The gotten file is writable.

`-l'

Unsupported.

`-lp'

Unsupported.

`-m'

Prepend to each line of the result the SID corresponding to the delta which introduced this line to the file.

`-n'

Precede each line of output with the module name, before any SID added with the `-m' option.

`-p'

Write the result to the standard output, rather than to a file.

`-rX'

Retrieve version X, rather than the default.

`-s'

Run silently.

`-t'

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).

`-V'

Show version information.

`-wXXX'

When performing keyword substitution (see section Keyword Substitution), use XXX rather than `%Z%%M% <TAB> %I%' as the substitution value for %W%.

`-xlist'

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] [ ? ]

3.5.3 Making Branches

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] [ ? ]

3.5.4 Keyword Substitution

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:

A

Expands to the same as `%Z% %Y% %M% %I% %Z%'.

B

The branch number of the gotten version

C

Current line in the output file

D

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).

E

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).

F

Name of the SCCS file, for example `s.foo.c'.

G

As for %E%, but in the US format mm/dd/yy.

H

As for %D%, but in the US format mm/dd/yy.

I

Expands to the same as %R%.%L%.%B%.%S%, that is, the SID of the retrieved version.

L

The level number of the retrieved version.

M

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.

P

Full name of the SCCS file.

Q

Value of the q flag. The q flag has no other purpose, and can be set with `admin -fqfoo'. See section Flags.

R

Release number of the retrieved version.

S

Sequence number of the retrieved version.

T

Current time (hh:mm:ss) when the file was retrieved, see %D% and %H%.

W

Expands to %Z% %M% <TAB> %I% or the argument for the `-w' flag, if given.

Y

Value of the t (module type) flag.

Z

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 Build Daemon user on December, 29 2005 using texi2html 1.76.