CO(1) CO(1)
名称
co - RCS ファイルからリビジョンをチェックアウトする
書式
co [options] file ...
解説
co は、各 RCS ファイルからリビジョンを取り出し、対応したワークファイル
に格納します。
RCS 拡張子にマッチするファイル名は RCS ファイルであるとみなし、その他の
フ ァイル名はワークファイルであるとみなします。ファイル名の対応に関して
は、 ci(1) を参照してください。
RCS ファイルのリビジョンは、ロックしてもしなくともチェックアウトでき ま
す 。リビジョンをロックすることにより、同時に複数の更新が行われることを
防止します。内容を表示したり、読むだけの処理(たとえば、コンパイル)で 用
い たりする場合はロックする必要はありません。編集し後にチェックインする
つもりで RCS ファイルから取り出す場合は、通常、ロックしなければなりませ
ん 。他のユーザによってロックされているリビジョンをロックしてチェックア
ウトしようとするとエラーになります(ロックは rcs(1) によって解除すること
ができます)。更に、リビジョンをロックしてチェックアウトするには、チェッ
クアウトする人が RCS ファイルのアクセスリストに登録されているか、そのフ
ァ イルの所有者もしくはスーパユーザであるか、アクセスリストが空である必
要が有ります。ロックしないで取り出す場合は、アクセスリストや他人のロ ッ
クに影響されることはありません。
取 り出されるリビジョンを、リビジョン番号、枝番号、チェックイン日時、作
者、状態によって指定するオプションが存在します。複数のオプションが組 み
合 わされて指定された場合、 co はすべての条件に合致するリビジョンのうち
で最新のものを取り出します。リビジョン指定オプションが指定されなかっ た
場合、 co は、デフォルト枝(通常は幹: rcs(1) の -b オプションの項を参照)
の最新のリビジョンを取り出します。リビジョン番号あるいは枝番号は、以 下
のオプションを使って指定することができます: -f, -I, -l, -M, -p, -q, -r,
-u 。オプション -d (日時)、 -s (状態)、 -w (作者)は、単一の枝から取り出
し ます。この枝は 選択された枝であり、 -f, ..., -u オプションもしくはデ
フォルト枝により指定されます。
リビジョンを 1 つも持たない RCS ファイルに対して co コマンドを適用す る
と、長さ 0 のワークファイルが作成されます。 co は、つねにキーワード置換
を行います (下記参照)。
オプション
-r[rev]
リビジョン番号 rev 以前( rev と同じものも含む)で最新のリビジョン
を 取り出します。 rev がリビジョンではなく枝を指定している場合、
その枝上の最新のリビジョンが取り出されます。 rev が省略された 場
合 、デフォルト枝 ( rcs(1) の -b オプションの項を参照)の最新のリ
ビジョンが取り出されます。 rev が $ の場合、 co はリビジョン番号
をワークファイルのキーワードから取り出します。これら以外の場合、
rev はリビジョンを示すピリオドで区切られた数字またはシンボルの列
で す。 rev がピリオドで始まる場合、デフォルトの枝(通常は幹)が設
定されます。 rev がピリオドを後ろに付けた枝番号であるならば、 そ
の枝の最新のリビジョンが使われます。シンボルは、 ci(1) や rcs(1)
によりリビジョン番号と結びつけることができます。
-l[rev]
-r と同様の動作ですが、取り出したリビジョンを呼び出したユーザ に
てロックします。
-u[rev]
-r と同様の動作ですが、取り出したリビジョンが呼び出したユーザに
よってロックされていたならば、そのロックを解除します。 rev が 省
略 された場合、 co を起動したユーザがロックしたリビジョンが 1 つ
あれば、そのリビジョンを取り出します; そうでなければ、デフォルト
枝の最新のリビジョンを取り出します。
-f[rev]
ワークファイルの上書きを強制します;後述の -q オプションを使用す
る場合、いっしょに -f オプションも指定すると便利な場合があります
。 ファイルモードの項も参照してください。
-kkv ワークファイルにデフォルト形式のキーワード文字列を埋め込みます。
たとえば、キーワード Revision に対しては、文字列 $Revision: 1.6
$ を生成します。 ci -l や co -l でファイルがロックされる時のみ、
Header, Id, Locker キーワードにロック者名を挿入します。これが デ
フォルトの動作です。
-kkvl -kkv とほぼ同様ですが、指定されたリビジョンがロックされていた場
合にはいつも、ロック者名を挿入します。
-kk キーワード文字列中のキーワード名のみの文字列を生成し、値は省略し
ま す。後述の キーワード置換を参照して下さい。たとえば、キーワー
ド Revision に対しては、通常の $Revision: 1.6 $ のか わ り に 、
$Revision$ を生成します。これは、異なるリビジョンの内容を比較す
る場合、キーワード値の違いを無視できるので、便利です。 -kk が 指
定 されても、キーワード $Log$ の後にはログメッセージが挿入されま
す。これはリビジョンを統合する変更に、より便利であることを意図し
ています。
-ko チェックインされる前のワークファイル中のキーワード文字列をそのま
ま出力します。たとえば、キーワード $Revision$ に対しては、チェッ
ク イ ン さ れ る 前に展開されていた文字列 $Revision: 1.1 $ が、
$Revision: 1.6 $ の代わりに展開されます。キーワード文字列の形 式
を取るバイト列が置換されてしまっては困るような場合(訳注:バイナリ
ファイル等)に便利でしょう。
-kb 元のキーワード文字列のバイナリイメージを生成します。これは、 -ko
とほぼ同じですが、入出力する全てのワークファイルをバイナリモード
で扱う点が違います。これは、Posix と Unix のホスト間ではたいした
違いではありません。が、DOS のようなシステムではバイナリファイル
を扱う場合、 RCS ファイルの初期化には rcs -i -kb を使わねばな ら
な い で しょう。また、全ての環境において、 rcsmerge(1) は通常、
-kb が働いている場合はファイルの統合を受け付けません。
-kv キーワード文字列としてキーワード値のみを生成します。たとえば、キ
ー ワ ード Revision に対して、通常の $Revision: 1.6 $ のかわりに
1.6 を生成します。これは、キーワード文字列から $Revision: $ のよ
うなキーワード区切りを取り除くことが困難なプログラミング言語用の
ファイル等を生成するために使用します。しかしながら、キーワード名
が取り除かれてしまうと、それ以降にキーワード置換を行うことができ
ないので、注意が必要です。キーワードを失うことはこのように危険で
あるため、本オプションを -l オプションと組み合わせて使うことはで
きません。また、ワークファイルの書き込み権はオフになります; 後で
ワ ークファイルを編集する場合は、 -kv オプションを指定せずにワー
クファイルを取り出してから行います。
-p[rev]
ワークファイルに格納する代わりに、対象となるリビジョンを標準出力
に書き出します。 co をパイプの一部として使用する場合に便利です。
-q[rev]
静かなモード; 診断メッセージを表示しません。
-I[rev]
対話モード; たとえ標準入力が端末でなくても、ユーザに対して問い合
わせを行います。
-ddate 選択された枝上の、 date 以前の登録日付を持つ、最新のリビジョンを
取り出します。日付と時刻は自由形式で指定します。タイムゾーンとし
て LT を指定することにより、ローカルタイムを使用することができま
す; 他の一般的なタイムゾーンも使用することができます。たとえば、
以下に挙げるいくつかの date 指定は、太平洋標準時における 1990 年
1 月 11 日午後 8 時と同時刻を示します (太平洋標準時は協定世界 時
(UTC) よりも 8 時間遅れです)。
8:00 pm lt
4:00 AM, Jan. 12, 1990 デフォルトは UTC
1990-01-12 04:00:00+00 ISO 8601 (UTC)
1990-01-11 20:00:00-08 ISO 8601 (ローカル時刻)
1990/01/12 04:00:00 伝統的 RCS 形式
Thu Jan 11 20:00:00 1990 LT ctime(3) + LT出力
Thu Jan 11 20:00:00 PST 1990 date(1)出力
Fri Jan 12 04:00:00 GMT 1990
Thu, 11 Jan 1990 20:00:00 -0800 インターネット RFC 822
12-January-1990, 04:00 WET
ほとんどの日付の項目にはデフォルト値があります。デフォルトのタイ
ムゾーンは UTC です。これは -z オプションにて優先指定すること が
出 来ます。他のデフォルト値は、年、月、日、時、分、秒 の順番で決
定されます。これらの項目のうち、少なくとも 1 つが指定されなけ れ
ばいけません。指定のある項目よりも先に決定される項目が省略されて
いる場合には、タイムゾーンにおける現在の値を使用します。他の省略
さ れ たフィールドには最小値が採用されます。たとえば、 -z 無しの
20, 10:30 の場合は、UTC タイムゾーンの現 在 の 年 月 の 20 日
10:30:00 UTC が採用されます。日付の指定に空白が含まれる場合には
、日付の指定をクオートでくくる必要があることに注意してください。
-M[rev]
作成されるワークファイルの最終更新日付を、取り出されるリビジョン
の日付にします。本オプションを指定すると make(1) が正しく動作 し
なくなるので、注意して使用する必要があります。
-sstate
選 択された枝上の、状態 state を持つ最新のリビジョンを取り出しま
す。
-T RCS ファイルの変更日付を変更しません。ロックされたりロック解除さ
れ たりして RCS ファイルが変更された場合でもです。このオプション
は、コピーした RCS ファイルのワークファイルを使って make(1) をか
ける際に再コンパイルをさせたくない場合に便利でしょう。このオプシ
ョンは必要であるにもかかわらず再コンパイルを行なわないことになっ
てしまう場合があるので注意が必要です。それは、ロックの変更が別の
ワークファイルのキーワード文字列の変更を行う時です。
-w[login]
選択された枝上の、ユーザ名 login によって登録された最新のリビ ジ
ョ ンを取り出します。 login が省略された場合は、 co を起動したユ
ーザ名を使います。
-jjoinlist
joinlist で指定されたリビジョンを結合した新しいリビジョンを作 成
します。本オプションは、旧バージョンとの互換性のために残されてい
ます。通常、リビジョンの結合には rcsmerge(1) を用います。
joinlist は rev2:rev3 形式のリビジョンの対をコロンで区切って並べ
たリストです。ここで、 rev2 と rev3 は(シンボリックまたは数字の)
リビジョン番号です。以下の説明で、 rev1 は以下のリビジョンを示し
ま す: (1) joinlist に列挙された対のうち、最初のものは、上記の
-f, ..., -w オプションによって選択されたリビジョンです。 (2) そ
れ以外の対に対しては、直前の対から作成されたリビジョン (すなわち
、1 つの対によって作成されたリビジョンは次の結合のための入力とな
ります)。
それぞれの対に対して、 co は rev1 と rev3 を rev2 と比較しながら
結合します。つまり、 rev2 を rev1 と同一にするための 変 更 を 、
rev3 のコピーに対して適用します。 rev2 を同一の祖先とする 2 つの
枝の末端のリビジョン rev1 と rev3 を結合するのによく用いられます
。 も し 、3 つのリビジョンが同一の枝上にあり、リビジョン番号が
rev1 CO(1) CO(1)
NAME
co - check out RCS revisions
SYNOPSIS
co [options] file ...
DESCRIPTION
co retrieves a revision from each RCS file and stores it into the cor-
responding working file.
Pathnames matching an RCS suffix denote RCS files; all others denote
working files. Names are paired as explained in ci(1).
Revisions of an RCS file can be checked out locked or unlocked. Lock-
ing a revision prevents overlapping updates. A revision checked out
for reading or processing (e.g., compiling) need not be locked. A
revision checked out for editing and later checkin must normally be
locked. Checkout with locking fails if the revision to be checked out
is currently locked by another user. (A lock can be broken with
rcs(1).) Checkout with locking also requires the caller to be on the
access list of the RCS file, unless he is the owner of the file or the
superuser, or the access list is empty. Checkout without locking is
not subject to accesslist restrictions, and is not affected by the
presence of locks.
A revision is selected by options for revision or branch number,
checkin date/time, author, or state. When the selection options are
applied in combination, co retrieves the latest revision that satisfies
all of them. If none of the selection options is specified, co
retrieves the latest revision on the default branch (normally the
trunk, see the -b option of rcs(1)). A revision or branch number can
be attached to any of the options -f, -I, -l, -M, -p, -q, -r, or -u.
The options -d (date), -s (state), and -w (author) retrieve from a sin-
gle branch, the selected branch, which is either specified by one of
-f, ..., -u, or the default branch.
A co command applied to an RCS file with no revisions creates a zero-
length working file. co always performs keyword substitution (see
below).
OPTIONS
-r[rev]
retrieves the latest revision whose number is less than or equal
to rev. If rev indicates a branch rather than a revision, the
latest revision on that branch is retrieved. If rev is omitted,
the latest revision on the default branch (see the -b option of
rcs(1)) is retrieved. If rev is $, co determines the revision
number from keyword values in the working file. Otherwise, a
revision is composed of one or more numeric or symbolic fields
separated by periods. If rev begins with a period, then the
default branch (normally the trunk) is prepended to it. If rev
is a branch number followed by a period, then the latest revi-
sion on that branch is used. The numeric equivalent of a sym-
bolic field is specified with the -n option of the commands
ci(1) and rcs(1).
-l[rev]
same as -r, except that it also locks the retrieved revision for
the caller.
-u[rev]
same as -r, except that it unlocks the retrieved revision if it
was locked by the caller. If rev is omitted, -u retrieves the
revision locked by the caller, if there is one; otherwise, it
retrieves the latest revision on the default branch.
-f[rev]
forces the overwriting of the working file; useful in connection
with -q. See also FILE MODES below.
-kkv Generate keyword strings using the default form, e.g. $Revision:
5.13 $ for the Revision keyword. A locker’s name is inserted in
the value of the Header, Id, and Locker keyword strings only as
a file is being locked, i.e. by ci -l and co -l. This is the
default.
-kkvl Like -kkv, except that a locker’s name is always inserted if the
given revision is currently locked.
-kk Generate only keyword names in keyword strings; omit their val-
ues. See KEYWORD SUBSTITUTION below. For example, for the
Revision keyword, generate the string $Revision$ instead of
$Revision: 5.13 $. This option is useful to ignore differences
due to keyword substitution when comparing different revisions
of a file. Log messages are inserted after $Log$ keywords even
if -kk is specified, since this tends to be more useful when
merging changes.
-ko Generate the old keyword string, present in the working file
just before it was checked in. For example, for the Revision
keyword, generate the string $Revision: 1.1 $ instead of $Revi-
sion: 5.13 $ if that is how the string appeared when the file
was checked in. This can be useful for file formats that cannot
tolerate any changes to substrings that happen to take the form
of keyword strings.
-kb Generate a binary image of the old keyword string. This acts
like -ko, except it performs all working file input and output
in binary mode. This makes little difference on Posix and Unix
hosts, but on DOS-like hosts one should use rcs -i -kb to ini-
tialize an RCS file intended to be used for binary files. Also,
on all hosts, rcsmerge(1) normally refuses to merge files when
-kb is in effect.
-kv Generate only keyword values for keyword strings. For example,
for the Revision keyword, generate the string 5.13 instead of
$Revision: 5.13 $. This can help generate files in programming
languages where it is hard to strip keyword delimiters like
$Revision: $ from a string. However, further keyword substitu-
tion cannot be performed once the keyword names are removed, so
this option should be used with care. Because of this danger of
losing keywords, this option cannot be combined with -l, and the
owner write permission of the working file is turned off; to
edit the file later, check it out again without -kv.
-p[rev]
prints the retrieved revision on the standard output rather than
storing it in the working file. This option is useful when co
is part of a pipe.
-q[rev]
quiet mode; diagnostics are not printed.
-I[rev]
interactive mode; the user is prompted and questioned even if
the standard input is not a terminal.
-ddate retrieves the latest revision on the selected branch whose
checkin date/time is less than or equal to date. The date and
time can be given in free format. The time zone LT stands for
local time; other common time zone names are understood. For
example, the following dates are equivalent if local time is
January 11, 1990, 8pm Pacific Standard Time, eight hours west of
Coordinated Universal Time (UTC):
8:00 pm lt
4:00 AM, Jan. 12, 1990 default is UTC
1990-01-12 04:00:00+00 ISO 8601 (UTC)
1990-01-11 20:00:00-08 ISO 8601 (local time)
1990/01/12 04:00:00 traditional RCS format
Thu Jan 11 20:00:00 1990 LT output of ctime(3) + LT
Thu Jan 11 20:00:00 PST 1990 output of date(1)
Fri Jan 12 04:00:00 GMT 1990
Thu, 11 Jan 1990 20:00:00 -0800 Internet RFC 822
12-January-1990, 04:00 WET
Most fields in the date and time can be defaulted. The default
time zone is normally UTC, but this can be overridden by the -z
option. The other defaults are determined in the order year,
month, day, hour, minute, and second (most to least signifi-
cant). At least one of these fields must be provided. For
omitted fields that are of higher significance than the highest
provided field, the time zone’s current values are assumed. For
all other omitted fields, the lowest possible values are
assumed. For example, without -z, the date 20, 10:30 defaults
to 10:30:00 UTC of the 20th of the UTC time zone’s current month
and year. The date/time must be quoted if it contains spaces.
-M[rev]
Set the modification time on the new working file to be the date
of the retrieved revision. Use this option with care; it can
confuse make(1).
-sstate
retrieves the latest revision on the selected branch whose state
is set to state.
-S Turns on same user locks. When this is enabled the user cannot
check out the same file twice.
-T Preserve the modification time on the RCS file even if the RCS
file changes because a lock is added or removed. This option
can suppress extensive recompilation caused by a make(1) depen-
dency of some other copy of the working file on the RCS file.
Use this option with care; it can suppress recompilation even
when it is needed, i.e. when the change of lock would mean a
change to keyword strings in the other working file.
-w[login]
retrieves the latest revision on the selected branch which was
checked in by the user with login name login. If the argument
login is omitted, the caller’s login is assumed.
-jjoinlist
generates a new revision which is the join of the revisions on
joinlist. This option is largely obsoleted by rcsmerge(1) but
is retained for backwards compatibility.
The joinlist is a comma-separated list of pairs of the form
rev2:rev3, where rev2 and rev3 are (symbolic or numeric) revi-
sion numbers. For the initial such pair, rev1 denotes the revi-
sion selected by the above options -f, ..., -w. For all other
pairs, rev1 denotes the revision generated by the previous pair.
(Thus, the output of one join becomes the input to the next.)
For each pair, co joins revisions rev1 and rev3 with respect to
rev2. This means that all changes that transform rev2 into rev1
are applied to a copy of rev3. This is particularly useful if
rev1 and rev3 are the ends of two branches that have rev2 as a
common ancestor. If rev1
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa