The RCS MINI-HOWTO <author> Robert Kiesling, <tt/kiesling@terracom.net/ <date>$Id: RCS-HOWTO.sgml,v 1.4 1997/08/14 15:09:56 rak Exp rak $ <trans>伊佐冶 哲, <tt/isaji@mxu.meshnet.or.jp/ <abstract> <!-- This document covers basic installation and usage of RCS, the GNU Revision Control System, under Linux. It also covers the installation of the <tt>diff(1)</tt> and <tt>diff3(1)</tt> utilities, which are necessary for RCS to operate. This document may be reproduced freely, in whole or in part, provided that any usage of this document conforms to the general copyright notice of the HOWTO series of the Linux Documentation Project. See the file COPYRIGHT for details. Send all complaints, suggestions, errata, and any miscellany to <htmlurl url="mailto:kiesling@terracom.net" name = "kiesling@terracom.net">, so I can keep this document as complete and up to date as possible. --> このドキュメントではLinux RCS(GNU Revision Control System)の基本的な インストールと使い方を取り扱っています。RCSを操作する上で必要な <tt>diff(1)</tt>と<tt>diff3(1)</tt>のインストールも取り扱っています。 LDPのHOWTOシリーズに関する&dquot;general copyright notice&dquot;に従う 限り、このドキュメントは全部/一部を自由に改変できます。 詳しくはCOPYRIGHTファイルを見て下さい。ご不満、提案、間違いなど ありましたら<htmlurl url="mailto:kiesling@terracom.net" name = "kiesling@terracom.net">まで。できるだけ今後のドキュメントに反映 したいと思っています。 </abstract> <toc> <sect>RCSの概要 <!-- Overview of RCS.--> <p> <!-- RCS, the revision control system, is a suite of programs that tracks changes in text files and controls shared access to files in work group situations. It is generally used to maintain source code modules. It lends itself to tracking revisions of document files as well. --> RCS(revision control system:リビジョン改訂コントロールシステム)は 共有アクセスをコントロールします。これは主にソースコードモジュール を管理するのに使われます。ドキュメントファイルのリビジョンの追跡にも 役立ちます。 <p> <quote><verb> 訳注:プログラムソースやドキュメントのバージョン管理/整備などに 使われます。共同でプログラム開発を行ったりドキュメントを 書くといった場合の重複を避けるのにも使われます。 </verb></quote> <p> <!-- RCS was written by Walter F. Tichy and Paul Eggert. The latest version which has been ported to Linux is RCS Version 5.7. There is also a semi-official, threaded version available. Much of the information in this HOWTO is taken from the RCS man pages. --> RCSはWalter F. Tichy氏とPaul Eggert氏によって書かれました。Linuxに ポートされている最新版はRCS Version 5.7です。これらは準公式、スレッド 版もあります。このHOWTOの情報の多くはRCS manページを参考に書かれています。 <p> <!-- RCS includes the <tt>rcs(1)</tt> program, which controls RCS archive file attributes, <tt>ci(1)</tt> and <tt>co(1)</tt>, which check files in and out of RCS archives, <tt>ident(1)</tt>, which searches RCS archives by keyword identifiers, <tt>rcsclean(1)</tt>, a program to clean up files that are not being worked on or haven't changed, <tt>rcsdiff(1)</tt>, which runs <tt>diff(1)</tt> to compare the revisions, <tt>rcsmerge(1),</tt> which merges two RCS branches into a single working file, and <tt>rlog(1),</tt> which prints RCS log messages. --> RCSは以下のプログラムから成ります(訳注:JM参照)。 <descrip> <tag><tt>rcs(1)</tt></tag> RCS ファイルの属性を変更します。rcs は、新規に RCS ファイルを作成したり、 RCS ファイルの属性を変更したりすることができます。RCS ファイルは、複数のリ ビジョン、アクセスリスト、変更履歴、内容記述、制御属性からなります。 rcs は、実行したユーザが RCS ファイルのアクセスリストに登録されているか、アク セスリストが空であるか、ユーザが RCS ファイルの所有者であるか、スーパー ユーザであるか、-i オプションが指定されている場合にのみ実行できます。 <p> RCS 拡張子にマッチするファイル名は RCS ファイルであるとみなし、その他の ファイル名はワークファイルであるとみなします。 <tag><tt>ci(1)</tt>と<tt>co(1)</tt></tag> RCSアーカイブのチェックインとチェックアウトをします。 <itemize> <item>co - (作成開始時に)RCS ファイルからリビジョンを取り出す <item>ci - (作成終了時に)RCS ファイルに新たなリビジョンを追加する </itemize> <tag><tt>ident(1)</tt></tag> ファイル内の RCS キーワードを読み出します。ident は、指定されたファイルが あればそのファイルから、指定がない場合には標準入力から、 <tt>$keyword:...$</tt> というパターンを検索します。 <p> これらのパターンは、通常 RCS の <tt/co/ コマンドにより自動的に挿入されますが、 手作業で入れることも可能です。オプション <tt/-q/ を指定すると、ファイル中に キーワードが発見できなくてもメッセージを出力しません。 <tt/ident/は、テキストファイルと同様にオブジェクトファイルにも使用することが できます。 <tag><tt>rcsclean(1)</tt></tag> RCSで管理されているファイルのうち不要なファイルを削除するプログラムです。 <tag><tt>rcsdiff(1)</tt></tag> <tt>diff(1)</tt>を使って RCS で管理されているリビジョンを比較します。 <tag><tt>rcsmerge(1)</tt></tag> 2つのRCSをひとつの作業ファイルにマージします(RCS ファイルのリビジョンを 併合する)。 <tag><tt>rlog(1)</tt></tag> RCSログメッセージ、その他関連情報を表示します。 </descrip> <p> <!-- Files archived by RCS may be text of any format, or binary if the <tt>diff</tt> program used to generate change files handles 8-bit data. Files may optionally include identification strings to aid in tracking by <tt>ident(1)</tt>. <p> RCS uses the utilities <tt>diff(1)</tt> and <tt>diff3(3)</tt> to generate the change files between revisions. A RCS archive consists of the initial revision of a file, which is version 1.1, and a series of change files, one for each revision. Each time a file is checked out of an archive with <tt>co(1)</tt>, edited, and checked back into the archive with <tt>ci(1)</tt>, the version number is increased, for example, to 1.2, 1.3, 1.4, and so on for successive revisions. --> RCSによってアーカイブできるファイルは任意のフォーマットのテキストファイル です。また、変更ファイルを生成するのに使われる<tt>diff</tt>プログラムが 8ビットデータを操作するなら、バイナリファイルも扱うことができます。 ファイルは、<tt>ident(1)</tt>によって追跡を助けるために、オプション的に 確認文字列を含むようになります。 <p> RCSは<tt>diff(1)</tt>、<tt>diff3(3)</tt>ユーティリティをリビジョン間の 変更ファイルを生成するのに使います。RCSアーカイブは各リビジョンの初期 リビジョンから成ります。ファイルは<tt>co(1)</tt>によってアーカイブを チェックアウトし、<tt>ci(1)</tt>によってアーカイブを編集そしてチェックイン します。リビジョンがうまくいくとバージョンは1.2, 1.3, 1.4といった具合に 連続して増えていきます。 <p> <!-- The archives themselves commonly reside in a <tt>./RCS</tt> subdirectory, although RCS has other options for archive storage. --> RCSにはアーカイブ保管用の他のオプションがありますが、 アーカイブそれ自身は<tt>./RCS</tt>サブディレクトリに置かれます。 <p> <!-- For an overview of RCS, see the <tt>rcsintro(1)</tt> manual page.--> RCSの概要については<tt>rcsintro(1)</tt>マニュアルページを参照して 下さい。 <sect>必要なシステム <!-- System requirements.--> <p> <!-- RCS needs <tt>diff(1)</tt> and <tt>diff3(3)</tt> to generate the context diff files between revisions. The diff utilities suite needs to be installed on your system, and when you install RCS, the software will check for its presence. --> RCSはリビジョン間のdiffファイルを生成するために<tt>diff(1)</tt> と<tt>diff3(3)</tt>を使います。diffユーティリティはシステムにインストール されている必要があります。RCSをインストールする時はこれらがあるかどうか チェックしておいて下さい。 <!-- Precompiled diffutils binaries are available at:--> プレコンパイルされたdiffutilsは <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/utils/text/diffutils-2.6.bin.ELF.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/utils/text/diffutils-2.6.bin.ELF.tar.gz"> とミラーサイトで入手できます。 <!-- and its mirror sites. If you need to compile <tt>diff(1)</tt>, et al., from source, it is located at: --> <tt>diff(1)</tt>等をソースからコンパイルする場合は: <htmlurl url="ftp://prep.ai.mit.edu/pub/gnu/diffutils-2.7.tar.gz" name="ftp://prep.ai.mit.edu/pub/gnu/diffutils-2.7.tar.gz"> <!-- and its mirror sites.--> とそのミラーサイトからソースを入手して下さい。 <!-- You will also need to have the ELF libraries installed on your system if you want to install pre-built binaries. See the ELF-HOWTO for further details. --> プレコンパイルされたバイナリをインストールする場合はELFライブラリ が必要です。詳しくは「ELF-HOWTO」を参照して下さい。 <sect>ソースからRCSをコンパイルする <!-- Compiling RCS from Source.--> <p> <!-- Get the source distribution of RCS Version 5.7. It is available at --> RCSバージョン5.7の配布ソースを入手します。 <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/devel/vc/rcs-5.7.src.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/devel/vc/rcs-5.7.src.tar.gz"> やそのミラーサイトにあります。 <!-- and its mirrors. After you have unpacked the archive into your source tree, you need to configure RCS for your system. This is done via the <tt>configure</tt> script in the source directory, which you need to execute first. This will generate a <tt>Makefile</tt> and the appropriate <tt>conf.sh</tt> for your system. You can then type --> ソースディレクトリにアーカイブを展開したらシステムにあうようにRCSを 設定する必要があります。これはソースディレクトリの<tt>configure</tt> スクリプトで行われます(一番始めに実行して下さい)。これにより<tt>Makefile</tt> とシステムに合った<tt>conf.sh</tt>が作られます。その後 <verb> make install </verb> <!-- which will build the binaries. At some point you may need to <tt>su</tt> to root so the binaries can be installed in the correct directories. --> としてバイナリを構築します。ここで<tt>su</tt>でrootになっておいて下さい。 これで正しいディレクトリにバイナリがインストールされます。 <sect>アーカイブの作成と管理 <!-- Creating and maintaining archives.--> <p> <!-- The program <tt>rcs(1)</tt> does the work or creating archives and modifying their attributes. A summary of <tt>rcs(1)</tt> options may be found in the <tt>rcs(1)</tt> manual page. --> <tt>rcs(1)</tt>プログラムはアーカイブの生成と属性の修正を 行います。<tt>rcs(1)</tt>オプションをまとめたものは<tt>rcs(1)</tt>の マニュアルページにあります。 <p> <!-- The easiest way to create an archive is first to <tt>mkdir RCS</tt> in the current directory, then initialize the archive with the --> アーカイブを作るもっとも簡単な方法は、カレントディレクトリで<tt>mkdir RCS</tt> として<tt>./RCS</tt>ディレクトリを作り、 <verb> rcs -i (作業ファイル名) </verb> コマンドでアーカイブを初期化することです。 <!-- command. This creates and archive with the name <tt>./RCS/name_of_work_file,v</tt> and requests a text message describing the archive, but it does not deposit any revisions in the archive. You can turn on or off strict archive locking with the commands --> これは作業ファイル名に<tt/,v/がついた<tt>./RCS/(作業ファイル名),v</tt> と言う名前のアーカイブ(訳注:これがRCSファイルです)を作り、アーカイブを記述す るテキストメッセージをリクエストします。しかしアーカイブにリビージョンを置く ことはしません。以下のコマンドを使ってアーカイブのロックをonにしたりoff にしたりできます。onは <verb> rcs -L (作業ファイル名) </verb> で、offは <verb> rcs -U (作業ファイル名) </verb> です。注意: <itemize> <item>「ロックされている」:ファイルの更新ができる <item>「ロックされていない」:ファイルの更新はできない. </itemize> <!-- respectively. There are other options for controlling access to the archive, setting its format, and setting revision numbers, which are covered in the <tt>rcs(1)</tt> manual page. --> アーカイブアクセスを操作したりフォーマットの設定、リビージョン番号をセット するためのオプションが他にもあります。<tt>rcs(1)</tt>のマニュアルページに 書かれています。 <sect>ci(1)とco(1) <p> <!-- <tt>ci(1)</tt> and <tt>co(1)</tt> are the commands used to check files in and out of their RCS archives. The <tt>ci(1)</tt> command may also be used to a check a file both in and out of an archive. In their simplest forms, <tt>ci(1)</tt> and <tt>co(1)</tt> take only the name of the working file. --> <tt>ci(1)</tt> と <tt>co(1)</tt>はRCSアーカイブのファイルをチェックする コマンドです。<tt>ci(1)</tt>コマンドはアーカイブのin と out 両方を チェックするのにも使われます。簡単なコマンドフォームでは、<tt>ci(1)</tt> と <tt>co(1)</tt>は作業ファイルの名前だけを指定します: <verb> ci (作業ファイル名) </verb> そして <verb> co (作業ファイル名) </verb> <!-- The command form --> コマンドフォーム <verb> ci -l (作業ファイル名) </verb> <!-- checks in the file with locking enabled, and --> はロック可能なファイルをチェックインされ、 <verb> co -l (作業ファイル名) </verb> <!-- <em>is performed automatically.</em> That is, <tt>ci -l</tt> checks the file out again with locking enabled. --> は<em>自動的に実行されます</em>。つまり<tt>ci -l</tt>は ロック可能のファイルをもう一度チェックします (訳注:<tt/-l/オプションはチェックインした後、またすぐにロックして取り出す ためのオプションです)。 <quote><verb> 訳注:co における -l オプションはロックして取り出すことを意味します。 ロックすると 次に自分が(作業ファイル)をチェックインするまで他人は (作業ファイル)をロックできなくなります。 </verb></quote> <p> <verb> ci -u (作業ファイル名) </verb> <!-- checks the file into the archive, and checks it out again with locking disabled. In all cases, the user is prompted for a log message. --> これはアーカイブ中のファイルをチェックします。そしてロック不可も チェックします。全ての場合においてログメッセージで表示されます。 <p> <!-- <tt>ci(1)</tt> will also create a RCS archive if one does not exist already. --> RCSアーカイブがないと<tt>ci(1)</tt>はアーカイブも作ります。 <p> <!-- If you don't specify a revision, <tt>ci(1)</tt> increments the version number of the last revision locked in the archive, and appends the revised working file to it. If you specify a revision on an existing branch, it must be higher than the existing revision numbers. <tt>ci(1)</tt> will also create a new branch if you specify the revision of a branch which does not exist. See the <tt>ci(1)</tt> and <tt>co(1)</tt> man pages for details. --> リビジョンを特定しない場合は<tt>ci(1)</tt>はアーカイブのロックされた 最新リビージョンのバージョンを増やし、改訂された作業ファイルにに追加 します。またすでにあるブランチ(branch)のリビージョンを特定すると、すでにある リビージョンよりも高い番号を付けます。 <quote><verb> 訳注:変更されているとci コマンドは変更分の差分を取り、新しい リビジョンへのコメント入力を求めます。コメントを入力す ると、新しいリビジョンとしてRCSディレクトリにチェックイン されます。 </verb></quote> <tt>ci(1)</tt>は存在しないブランチのリビジョンを指定すると新しいブランチ を生成します。詳しいことは<tt>ci(1)</tt>と<tt>co(1)</tt>のmanページを参照 して下さい。 <p> <!-- <tt>ci(1)</tt> and <tt>co(1)</tt> have various options for interactive and non-interactive use. Again, see the <tt>ci(1)</tt> and <tt>co(1)</tt> man pages for details. --> <tt>ci(1)</tt> と <tt>co(1)</tt>は相互に作用する(あるいは作用しない) さまざまなオプションがあります。同様に詳しいことは<tt>ci(1)</tt> と<tt>co(1)</tt>のmanページを参照して下さい。 <sect>リビジョンヒストリー <!-- Revision histories.--> <p> <!-- The <tt>rlog(1)</tt> program provides information about the archive file and the logs of each revision stored in it. A command like --> <tt>rlog(1)</tt>プログラムはアーカイブファイルとストアされている各 リビジョンのログについての情報を提供します。コマンドは <verb> rlog (作業ファイル) </verb> のように使います。 <!-- will print the version history of the file, each revision's creation date and <tt>userids</tt> of author and the person who locked the file. You can specify archive attributes and revision parameters to view. --> これはファイルのバージョン履歴、改訂の作成日付、作者の<tt>userids</tt>、 ファイルを管理している人などを表示します。アーカイブ属性と 改訂パラメータを指定することができます。 <sect>作業ファイルにRCSデータを入れる <!-- Including RCS data in working files.--> <p> <!-- <tt>co(1)</tt> maintains a list of keywords of the RCS database which are expanded when the working file is checked out. The keyword <tt>$Id$</tt> in a document will expand to a string which contains the file name, revision number, the date checked out, the author, the revision status, and the locker, if any. Including the keyword <tt>$Log$</tt> will expand to the document's revision history log. --> <tt>co(1)</tt>はRCSデータベースのキーワードリストを管理します。このデータ ベースは作業ファイルがチェックアウトされる時に展開されます。ドキュメント中 にあるキーワード<tt>$Id$</tt>はファイル名、改訂番号、 チェックアウトした日付、著者、改訂の事情、ロッカー(置き場所)から成る文字列 に展開されます。キーワード<tt>$Log$</tt>はドキュメントの リビジョン履歴ログに展開されています。 <p> [<bf/訳注:/作業ファイルにRCSデータを入れるには <verb> co -l (作業ファイル) </verb> でチェックアウトしたファイルに <code> $Id: RCS.sgml,v 1.1 1998/02/28 08:54:44 isaji Exp isaji $ </code> を書き入れます(SGMLなどだったら<tt><!-- 〜 --></tt>でコメント したりしておきます)。そして<tt/co -l /とすると<tt>$Id$</tt> の後に <code> $Id: RCS.sgml,v 1.1 1998/02/28 08:54:44 isaji Exp isaji $ </code> といった情報が入ります。その他情報を入れるキーワードはmanページ から引用すると(日本語manページからです): <p> キーワードの種類とその値: <descrip> <tag>$Author$</tag> リビジョンを登録したユーザのログイン名 <tag>$Date$</tag> リビジョンが登録された日時(UTC) <tag>$Header$</tag> 標準的なヘッダ。RCS ファイルのフルパス名、リビ ジョ ン番号、日時、作者、状態、ロック者が含まれます。 <tag>$Id$</tag> $Header$ とほぼ同様です。RCS ファイル名は、パスをつ けずに埋め込まれます。 <tag>$Locker$</tag> リビジョンをロックしたユーザのログイン名 <tag>$Log$</tag> 登録時に与えたログメッセージ。ヘッ ダ と し て、RCS ファ イル名、リビジョン番号、作者、日時が埋め込まれ る。すでに埋め込まれているログメッセージは変更さ れ ず、新たなログメッセージのみが<tt>$Log:...$</tt> のあとに追 加される。ソースファイルの完全なログを記録すると き に便利である。 <tag>$rcsfile$</tag> パス名を含まない RCS ファイル名 <tag>$Revision$</tag> リビジョン番号 <tag>$Source$</tag> RCS ファイルのフルパス名 <tag>$State$</tag> リビジョンに rcs(1) か ci(1) の -s オプションにより 割り付けられた状態。 </descrip> となっています(この注はJMを参考/引用しました)] <p> <!-- These and other keywords may be used as search criteria of the RCS archive. See the <tt>ident(1)</tt> man page for further details. --> これらおよび他のキーワードはRCSアーカイブの基準検索として使われます。 詳細は<tt>ident(1)</tt> manページを参照して下さい。 <p> [訳注:ident - ファイル内の RCS キーワードを読み出すコマンドです。 ident は、テキストファイルと同様にオブジェクトファイルにも 使用することができ、どのようなバージョンのソースから作られているか わかります。たとえば、以下の C 言語プログラム f.c で、 <code> char rcsid[] = "$Id$"; </code> あるいは <code> static char rcsid[] = "$Id$"; </code> として、f.c が f.o にコンパイルされているなら、 <verb> ident f.c f.o </verb> と実行すると、 <quote><verb> f.c: $Id: f.c,v 1.2 1993/07/24 02:51:17 jtc Exp $ f.o: $Id: f.c,v 1.2 1993/07/24 02:51:17 jtc Exp $ </verb></quote> といった出力をします] <sect>RCSとemacs(1)バージョンコントロール <!-- RCS and <tt>emacs(1)</tt> Version Control.--> <p> [訳注:Cソースを書いたりHTMLを編集したりすることの多いなかで muleと使うと便利です] <p> <!-- The Version Control facility of <tt>emacs(1)</tt> works as a front end to RCS. This information applies specifically to Version 19.34 of GNU Emacs, which is provided with the major Linux distributions. When editing a file with <tt>emacs(1)</tt> which is registered with RCS, the command <tt>vc-toggle-read-only</tt> (bound to <tt>C-x C-q</tt> by default) will check a file in to the emacs's Version Control, and then into RCS. Emacs will open a buffer where you can type a log message to be included in the RCS log. When you are finished typing a log entry, type <tt>C-c C-c</tt> to terminate your input and proceed with the check-in process. --> <tt>emacs(1)</tt>のバージョンコントロール機能はRCSのフロントエンドとして 使えます。この情報はLinux配布パッケージで提供されているGNU Emacs バージョン 19.34で確認しています。RCSで登録されているファイルを<tt>emacs(1)</tt>で編集 する時は<tt>vc-toggle-read-only</tt>コマンド(デフォルトで<tt>C-x C-q</tt>に バインドされています)を使います。 EmacsはRCSログにログメッセージをタイプするバッファを開きます。ログエントリ の入力を終了する時は<tt>C-c C-c</tt>として下さい。チェックイン処理で 入力、続行を終了します。 <p> <!-- If you have selected strict locking for the file with RCS, you must re-lock the file for editing by <tt>emacs(1)</tt>. You can check the file out for emacs's Version Control with the command <tt>%</tt> in buffer-menu mode. --> RCSで厳密なファイルロックを選択した時は<tt>emacs(1)</tt>によって編集される ファイルを再ロックしなければなりません。バッファメニューモードの <tt>%</tt>コマンドでEmacsのバージョンコントロールでファイルをチェック アウトすることができます。 <!-- For more information, see the GNU Emacs Manual and the Emacs info pages. --> より詳しいことはGNU EmacsマニュアルとEmacs infoページを参照して下さい。 [訳注:RCSで管理されているSGMLファイルをmuleで開くと mule画面のメジャーモードSGML、マイナーモードRCS:1.0になっている と思います(これが出ない時はカレントでRCSディレクトリを作っていなく まだRCSで管理されていません)。 <code> -かんなE.:--%%-Mule: Coffee.sgml (SGML RCS:1.0)--L1--Top--------- </code> これがRCSモードです。<tt>C-x C-q</tt>でチェックイン、チェックアウト を切替えられます(ミニバッファの辺りで交互に<tt>%%</tt>、<tt>--</tt> あるいは<tt>**</tt>が切り替わっています)。 変更後は<tt>C-c C-c</tt>でライトプロテクトしておきます。] <p> [ 日本語訳:伊佐冶 哲, <htmlurl url="mailto:isaji@mxu.meshnet.or.jp" name="isaji@mxu.meshnet.or.jp"><p> 訳文についての感想、訂正などありましたらご連絡下さい] </article>