<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>橋本雄の技術ブログ &#187; mercurial</title>
	<atom:link href="http://labs.asunochikara.com/tag/mercurial/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.asunochikara.com</link>
	<description>橋本雄がvim、ubuntu、phpなどの技術情報をまとめています</description>
	<lastBuildDate>Fri, 14 May 2010 14:17:59 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://labs.asunochikara.com/tag/mercurial/feed/" />
		<item>
		<title>XREAにmercurialをインストールして利用する方法</title>
		<link>http://labs.asunochikara.com/2010/01/mercurial/</link>
		<comments>http://labs.asunochikara.com/2010/01/mercurial/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 04:07:28 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[XREA]]></category>

		<guid isPermaLink="false">http://labs.asunochikara.com/?p=233</guid>
		<description><![CDATA[いろいろとやりたくなってmercurialをインストールしてみました
まずは、
http://www.selenic.com/mercurial/release/
から、最新のバージョンを確認してダウンロードします。

 [...]]]></description>
			<content:encoded><![CDATA[<p>いろいろとやりたくなってmercurialをインストールしてみました</p>
<p>まずは、</p>
<p>http://www.selenic.com/mercurial/release/</p>
<p>から、最新のバージョンを確認してダウンロードします。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.selenic.com<span style="color: #000000; font-weight: bold;">/</span>mercurial<span style="color: #000000; font-weight: bold;">/</span>release<span style="color: #000000; font-weight: bold;">/</span>mercurial-1.4.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvzf mercurial-1.4.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> mercurial-1.4.1</pre></div></div>

<p>すぐにインストールを開始したいところですが、pythonの実行環境を準備しないといけません。<br />
.bashrcに以下を記載します</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/local/bin:<span style="color: #007800;">$PATH</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TERM</span>=xterm-256color
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #000000; font-weight: bold;">/</span>virtual<span style="color: #000000; font-weight: bold;">/</span>ユーザーID<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>python
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">view</span>=<span style="color: #ff0000;">&quot;vim -R&quot;</span></pre></td></tr></table></div>

<p>これで実行環境が準備できました。インストール実行します</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> .bashrc
python sup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--home</span>=<span style="color: #000000; font-weight: bold;">/</span>virtual<span style="color: #000000; font-weight: bold;">/</span>ユーザーID<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></pre></div></div>

<p>これで、完了です。<br />
続いてHTTPで公開するため、公開ディレクトリに　~/local/src/mercurial-1.4.1にできた<br />
hgwebdir.cgi<br />
をコピー、新たに<br />
hgweb.configを以下のように作成します</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>collections<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">;;</span> レポジトリを作ってから、ここに記載します。
<span style="color: #000000; font-weight: bold;">/</span>virtual<span style="color: #000000; font-weight: bold;">/</span>ユーザーID<span style="color: #000000; font-weight: bold;">/</span>xxxx = <span style="color: #000000; font-weight: bold;">/</span>virtual<span style="color: #000000; font-weight: bold;">/</span>ユーザーID<span style="color: #000000; font-weight: bold;">/</span>xxxx<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>web<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">style</span>=gitweb
<span style="color: #7a0874; font-weight: bold;">&#91;</span>extensions<span style="color: #7a0874; font-weight: bold;">&#93;</span>
hgext.keyword =
<span style="color: #007800;">color</span>=
<span style="color: #7a0874; font-weight: bold;">&#91;</span>keyword<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">*</span> =
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>ui<span style="color: #7a0874; font-weight: bold;">&#93;</span>
username = My Name <span style="color: #000000; font-weight: bold;">&lt;</span>email at example dot com<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>を作成します<br />
さらに、便利に使うため、.htaccessを作成</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">Options +ExecCGI
RewriteEngine on
RewriteRule ^hgwebdir.cgi - <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span>hgwebdir.cgi<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span>
&nbsp;
AuthUserFile <span style="color: #000000; font-weight: bold;">/</span>virtual<span style="color: #000000; font-weight: bold;">/</span>ユーザーID<span style="color: #000000; font-weight: bold;">/</span>.htpasswd
AuthGroupFile <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
AuthName MembersOnly
AuthType Basic
<span style="color: #000000; font-weight: bold;">&lt;</span>limit GET POST PUT<span style="color: #000000; font-weight: bold;">&gt;</span>
require valid-user
<span style="color: #000000; font-weight: bold;">&lt;/</span>limit<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>基本認証のパスワードを.htpasswdとして、<br />
/virtual/ユーザーID/<br />
に保存します<br />
以上で、インストールと環境は完成です！</p>
<p>つづいてレポジトリを作成<br />
管理したいディレクトリにて、</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">hg init</pre></div></div>

<p>これで完成です<br />
レポジトリごとにいろいろな設定が可能です。<br />
バージョン管理から除外するファイルの設定を<br />
レポジトリの管理ディレクトリに、.hgignore　というファイルを作成します。以下はサンプル</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;">syntax: glob
*.log
.htaccess
*/tmp/*
*/config/*</pre></td></tr></table></div>

<p>これでOKです。<br />
あとは、hgコマンドを使って操作してください。</p>
<p>続いてクライアント側の操作です<br />
クライアント側にも同様にして、mercurialのインストールが必要です。まあ、クライアントもサーバーもないのがmercurialなんですけれど。<br />
インストールが終わったら、サーバー側のレポジトリから情報を引っ張ってきます</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> hg clone http:<span style="color: #000000; font-weight: bold;">//</span>example.com<span style="color: #000000; font-weight: bold;">/</span>xxxxxx yyyy
<span style="color: #000000; font-weight: bold;">//</span> xxxxxxxには、設定したレポジトリ名が入ります
<span style="color: #000000; font-weight: bold;">//</span>yyyyには、クライアント側に作成するレポジトリ名が入ります</pre></div></div>

<p>これでOKです。<br />
あとは、hg add hg ci などとやっていけばバージョン管理完成です</p>
<p>追記<br />
mercurial本が出ていました<br />
<div class="tmkm-amazon-view">
	<p><a href="http://www.amazon.co.jp/%E5%85%A5%E9%96%80Mercurial-Linux-Windows%E5%AF%BE%E5%BF%9C-%E8%97%A4%E5%8E%9F-%E5%85%8B%E5%89%87/dp/4798021741%3FSubscriptionId%3DAKIAJ2A52NNQKO2QRHRQ%26tag%3Dfleuraison-22%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D4798021741"><img src="http://ecx.images-amazon.com/images/I/41ZoE4KHVqL._SL160_.jpg" border="0" alt="" /></a></p>
	<p><a href="http://www.amazon.co.jp/%E5%85%A5%E9%96%80Mercurial-Linux-Windows%E5%AF%BE%E5%BF%9C-%E8%97%A4%E5%8E%9F-%E5%85%8B%E5%89%87/dp/4798021741%3FSubscriptionId%3DAKIAJ2A52NNQKO2QRHRQ%26tag%3Dfleuraison-22%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D4798021741">入門Mercurial Linux/Windows対応</a></p>
	<p><em>著者／訳者：</em>藤原 克則</p>
	<p><em>出版社：</em>秀和システム( 2009-01 )</p>
	<p><em>定価：</em>￥ 2,310</p>
	<p><em>Amazon価格：</em>￥ 2,310</p>
	<p>単行本 ( 307 ページ )</p>
	<p>ISBN-10 : 4798021741</p>
	<p>ISBN-13 : 9784798021744</p>
<hr class="tmkm-amazon-clear" /></div>
]]></content:encoded>
			<wfw:commentRss>http://labs.asunochikara.com/2010/01/mercurial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://labs.asunochikara.com/2010/01/mercurial/" />
	</item>
	</channel>
</rss>
