2008年10月
    11月 »
 12345
6789101112
13141516171819
20212223242526
2728293031  

カテゴリー

Mercurialをつかってみる その2 (チェックイン編)

インストールは無事完了したので、
実際にetc以下の設定ファイルをMercurialを使ってバージョン管理の対象にする。
手順は、

設定ファイルのあるディレクトリで、リポジトリの初期化
初期化したリポジトリに対して、ファイルを追加

svnと違って、リポジトリというのはディレクトリごとに作成する点が異なる点がポイント。
では、実際にやってみたログ。
%sudo hg add *
adding bluetooth/hcsecd.conf
adding bluetooth/hosts
(略)
adding ssl/openssl.cnf
% ls .hg
00changelog.i dirstate requires store
% sudo hg commit -m ‘initial import’
No username found, using ‘root@localhost.localdomain’ instead
こんなかんじで、hg add * で現在のディレクトリ以下すべてが、カレントディレクトリの.hg以下のリポジトリに記録される。
(上記例では、/etc/**/*が/etc/.hgのリポジトリに格納されたことになる。
svnと大きく違うのは、単純にinitだけをすればよくて、importして、checkoutをしてといった手間が不要になること。
checkoutをしないので、ファイルのパーミッションが変わったりオーナーが変わったりとかしないこと。
これはmercurialのメリット。
ほかには、変更の確認はsvnとおなじで、hg diffで見たり、コミットはhg commitだったりするので、
基本的に違和感なく使えると思う。

Mercurialをつかってみる その1 (インストール編)

FreeBSDで、分散バージョン管理システムMercurialを使ってみる。
目標は、開発用の自宅サーバについて、

/etc/*
/usr/local/etc/*

の設定ファイルのバージョン管理を行うこと。
なんでgitじゃないの?っていうのは、なんとなく。
てなわけで、まずはインストール。
% whereis mercurial
mercurial: /usr/ports/devel/mercurial
% cd /usr/ports/devel/mercurial
% sudo make install
% which hg
/usr/local/bin/hg
% hg –version
Mercurial Distributed SCM (version 1.0.2)
Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
簡単にインストールできたので、次は/etc以下を実際にimportして、バージョン管理を始める方法です。

autohotkeyでキーバインド編集

vistaだと窓使いの憂鬱がサポート外なので、対応策として、2つの策をとる。

capsとctrlはレジストリの編集で入れ替える。
その他のキーバインド編集は、autohotkeyを常駐させることにする。

autohotkeyスクリプトは以下
; autohotkey by kakkyz 08.10.11
vk1Csc079::enter     ;変換 -> Enter
vkF2sc070::vkF3sc029 ;カタカナひらがな -> 半角/全角
vk1Dsc07B::Esc       ;無変換 -> Esc
コンパイル済みのexeをダウンロードする

cap deploy:setup で Net::SSH::HostKeyMismatch

ログは以下
[412]% cap deploy:setup                                                                                                                                                                                       [/home/hoge/work/sbmm/trunk]
  * executing `deploy:setup’
  * executing “sudo -p ’sudo password: ‘ mkdir -p /home/www/hoge.com /home/www/hoge.com/releases /home/www/hoge.com/shared /home/www/hoge.com/shared/system /home/www/hoge.com/shared/log /home/www/hoge.com/shared/pids && sudo -p ’sudo password: ‘ chmod g+w /home/www/hoge.com /home/www/hoge.com/releases /home/www/hoge.com/shared /home/www/hoge.com/shared/system /home/www/hoge.com/shared/log /home/www/hoge.com/shared/pids”
    servers: ["hoge.com"]
D, [2008-10-10T22:33:54.682368 #25783] DEBUG — net.ssh.transport.session[1465226e]: establishing connection to hoge.com:22
D, [2008-10-10T22:33:54.997627 #25783] DEBUG — net.ssh.transport.session[1465226e]: connection established
I, [2008-10-10T22:33:54.997731 [...]