tanamonの稀に良く書く日記

KEEP CALM AND DRINK BEER

Fedora12にMercurialを入れてみる

インストール

# yum install mercurial
...

# hg version
Mercurial Distributed SCM (version 1.4)

Copyright (C) 2005-2009 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.

リポジトリの作成

# mkdir -p /opt/mercurial/repos
# cd /opt/mercurial/repos
# hg init
# ll .hg
合計 12
-rw-r--r-- 1 root root   57 2009-12-07 11:39 00changelog.i
-rw-r--r-- 1 root root   23 2009-12-07 11:39 requires
drwxr-xr-x 2 root root 4096 2009-12-07 11:39 store

Apache経由でアクセスできるようにする

# cd ..
# mkdir html
# cp /usr/share/doc/mercurial-1.4/hgweb.cgi /opt/mercurial/html/index.cgi
# chown apache:apache -R /opt/mercurial/html
# chmod 755 html/index.cgi
# vi inde.cgi
...
import sys
sys.path.insert(0, "/usr/lib64/python2.6/site-packages")
...
application = hgweb("/opt/mercurial/repos", "test repository")
wsgicgi.launch(application)
...
# vi /etc/httpd/conf.d/hg.conf
Alias /hg "/opt/mercurial/html"
<Directory "/opt/mercurial/html">
    DirectoryIndex index.cgi
    AddHandler cgi-script .cgi
    AllowOverride All
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>
# service httpd restart

TortoiseHgでテキトウにpush

pushing to http://192.168.30.46/hg/
searching for changes
1 changesets found
ssl required
[command returned code 1 Mon Dec 07 13:27:03 2009]

エラーが出た。

# cd /opt/mercurial/repos
# vi .hg/hgrc
[web]
push_ssl = false

SSLを使わないように設定。

再度push

pushing to http://192.168.30.46/hg/
searching for changes
1 changesets found
abort: authorization failed
[command interrupted]

またエラー

# vi .hg/hgrc
[web]
push_ssl = false
allow_push = *

誰でもpushできるように設定。

再々度push

pushing to http://192.168.30.46/hg/
searching for changes
1 changesets found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
[command completed successfully Mon Dec 07 13:31:03 2009]

今度は通った。