Time-stamp: "1999-10-30 19:53:34 yasuhide"

CVS で自分のページの履歴を管理する

  1. 初期設定
  2. 試しに使ってみる
    1. 登録する
    2. 登録されたファイルを取り出す
    3. ファイルの変更点を確認する
    4. 修正したファイルを登録する
    5. 作業したファイルを削除する
    6. SSH で接続する
    7. ファイルを追加・移動・削除する
      (この項目は私が書いたものではないのであしからず…。)
  3. 今回の失敗

初期設定

$ echo "(server-start)" >> ~/.emacs
$ echo export CVSROOT=~/practice/cvsroot >> ~/.bash_profile
$ echo export CVSEDITOR=emacsclient >> ~/.bash_profile
$ mkdir -p ~/practice/cvsroot
これで cvs を使うための下準備は整いました。 あとは、面倒なら再ログインしましょう。
$ cvs init
で、cvs のデータベースが初期化されます。

~/.cvswrappers には、

試しに使ってみる

取り出す chechout
破棄する release
更新を反映させる commit
キーワード置換を止める -ko

登録する 参考資料: import のオプション

http://www-vox.dj.kit.ac.jp/nishi/cvs/cvs-01.html を読みながらやってみる。

登録したいものの directory に移動して、

$ cvs import web-geo hide start
を実行する。

上記のコマンドを実行すると、emacs(mule) に新規バッファができる。 そこにメモを書いておくとのちのち便利なはず。

書き終わったら、C-x # して emacsclient を終了させる。すると、

N web-geo/index.html
N web-geo/about_link.html
N web-geo/template.html
N web-geo/what_s_new.html
N web-geo/monologue.html
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/linux
N web-geo/linux/index.html
N web-geo/linux/troubles.html
N web-geo/linux/rpms.html
N web-geo/linux/sitecopy.html
N web-geo/linux/qmail.html
N web-geo/linux/mutt.html
N web-geo/linux/fetchmail.html
N web-geo/linux/fetchmailconf.png
N web-geo/linux/ftp.html
N web-geo/linux/gnomeicu-clash.txt
N web-geo/linux/fetchmail_expert_configurator.png
N web-geo/linux/usb.txt
N web-geo/linux/xsitecopy.png
N web-geo/linux/30620.txt
I web-geo/linux/index.html~
N web-geo/linux/template.html
N web-geo/linux/gnomeicu.html
N web-geo/linux/maximum-rpm.html
N web-geo/linux/rpm-mode.html
N web-geo/linux/30621.txt
N web-geo/linux/gtkicq.html
N web-geo/linux/gicq.png
N web-geo/linux/gtkicq-0.60-1vl7.src.rpm
N web-geo/linux/cvs.html
N web-geo/linux/rpm-package.html
I web-geo/linux/sound.html~
N web-geo/linux/x-fonts.html
N web-geo/linux/sound.html
N web-geo/linux/fetchmailconf_server_options.png
N web-geo/linux/fetchmailconf_user_options.png
N web-geo/linux/usbtypo.txt
N web-geo/linux/links.html
N web-geo/linux/gicq.html
N web-geo/linux/mew.html
N web-geo/linux/vine.png
N web-geo/linux/gimp_logo.png
I web-geo/linux/gnomeicu-clash.txt~
N web-geo/linux/rebuild_srpm.html
N web-geo/linux/ruby_tk.html
N web-geo/linux/imput.html
N web-geo/linux/sitecopy-0.6.0-2_without_gnome.src.rpm
N web-geo/linux/gimp_workspace.png
N web-geo/linux/libjcode-1.00-7.src.rpm
N web-geo/linux/gtkicq_customize.html
N web-geo/linux/libjcode-1.00-7.i386.rpm
N web-geo/linux/sitecopy-0.6.0-2vl1.i386.rpm
I web-geo/linux/x-fonts.html~
I web-geo/linux/cvs.html~
N web-geo/linux/xsitecopy-0.6.0-2vl1.i386.rpm
N web-geo/linux/sitecopy-0.6.0-2vl1.src.rpm
N web-geo/linux/gnomeicu-0.65_jp-3.i386.rpm
L web-geo/linux/isapnp.conf.txt
N web-geo/linux/gtkicq-0.60-1vl7.i386.rpm
N web-geo/linux/gnomeicu-0.65_jp-3.src.rpm
N web-geo/linux/gnomeicu_customize.html
N web-geo/linux/parallel-zip.html
N web-geo/linux/gnomeicu-0.65_jp-2.src.rpm
N web-geo/linux/gnomeicu-0.65_jp-2.i386.rpm
N web-geo/linux/bash-1.14.7-13vl8.nosrc.rpm
N web-geo/linux/bash-1.14.7-13vl8.i386.rpm
N web-geo/linux/xhangglider-0.92e-1.i386.rpm
N web-geo/linux/xhangglider-0.92e-1.src.rpm
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/linux/for_beginners
N web-geo/linux/for_beginners/index.html
N web-geo/linux/for_beginners/after_installation.html
N web-geo/linux/for_beginners/using_sitecopy.html
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/unix_tips
N web-geo/unix_tips/index.html
I web-geo/unix_tips/index.html~
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/unix_tips/fj_questions_unix
N web-geo/unix_tips/fj_questions_unix/5023.txt
N web-geo/unix_tips/fj_questions_unix/5027.txt
N web-geo/unix_tips/fj_questions_unix/5029.txt
N web-geo/unix_tips/fj_questions_unix/5031.txt
N web-geo/unix_tips/fj_questions_unix/5024.txt
N web-geo/unix_tips/fj_questions_unix/5025.txt
N web-geo/unix_tips/fj_questions_unix/5026.txt
N web-geo/unix_tips/fj_questions_unix/5028.txt
N web-geo/unix_tips/fj_questions_unix/5030.txt
N web-geo/unix_tips/fj_questions_unix/5022.txt
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/unix_tips/fj_comp_imput-method_wnn
N web-geo/unix_tips/fj_comp_imput-method_wnn/12.txt
N web-geo/unix_tips/fj_comp_imput-method_wnn/13.txt
N web-geo/unix_tips/fj_comp_imput-method_wnn/14.txt
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/windows
N web-geo/windows/2028.txt
N web-geo/windows/2131.txt
N web-geo/windows/2132.txt
N web-geo/windows/2142.txt
N web-geo/windows/2152.txt
N web-geo/windows/2158.txt
N web-geo/windows/2164.txt
N web-geo/windows/2166.txt
N web-geo/windows/2170.txt
N web-geo/windows/2176.txt
N web-geo/windows/2206.txt
N web-geo/windows/index.html
cvs import: Importing /home/yasuhide/practice/cvsroot/web-geo/qt
N web-geo/qt/index.html
N web-geo/qt/font.html
I web-geo/qt/font.html~
I web-geo/qt/index.html~

No conflicts created by this import

というようなメッセージがコンソールに出てくるはず。
N で始まる行は新規登録 (New) 、I で始まる行は無視 (Ignore) の意味だろう。

-I *~ でバックアップファイルを除外する必要があるのかと最初思ったけど、 不要みたい。man cvs には、

By default, certain file names are ignored during `cvs import': names associated with CVS administration, or with other common source control systems; common names for patch files, object files, archive files, and editor backup files; and other names that are usually artifacts of assorted utilities. For an up to date list of ignored file names, see the Cederqvist manual (as described in the SEE ALSO section of this manpage).
って書いてあったわ。

プロジェクト名 web-geo
ベンダータグ (releasetag) hide
リリースタグ (releasetag) start

登録されたファイルを取り出す

$ cvs co -d ~/web-geo web-geo

ファイルの変更点を確認する 参考資料: 差分を見る A.8 diff---リビジョン間の差分を見る

$ cvs diff -u cvs.html | less

修正したファイルを登録する 参考資料: 変更の格納

$ cvs commit cvs.html
わざわざエディタを開くのが嫌ならば、
$ cvs commit -m \
"Added description not to use editer when committing." \
cvs.html

作業したファイルを削除する 参考資料: お掃除

$ cvs release -d cvs.html

SSH で接続する 参考資料: rsh で接続する

CVS_RSH="ssh"
export CVS_RSH

今回の失敗

cvs に登録するときには、登録すべきものの topdir に移っていることを確認してから cvs import しましょう。

間違って $HOME で cvs import しようものなら…(以下省略)。
まあ、そういうときは落ち着いて、$CVSROOT 以下の CVSROOT 以外の directory を rm -rf で削除しましょう。

スティッキータグ (sticky tag)
cvs commit: sticky tag `1.1' for file `linux/cvs.html' is not a branch
cvs update -A
17 バイナリ・ファイルの扱い
cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag

オプションについては以下の通り。

-W
フィルタを適用したいファイルを指定します。 フィルタを適用したいファイルが複数あるときは、 このオプションを何個並べても構いません。 ファイル `.cvswrappers' での指定方法と同じ形式で指定します。 以下のコマンドで利用できます: import, update.

info の日本語訳は

にあります。慣れたら、自分の分からない所や、 もっと知りたい所を中心に読むといいでしょうね。

info の索引は

にあります。分からないオプションやキーワードについては、 ここから探ればたどり着けるでしょう。

何かうまい工夫を見いだしたら教えてくださいませ。

メールは dasen@typhoon.co.jp まで。