apt-get update
apt-get install apache2
apt-get install python python-dev python-docutils
apt-get install mercurial
hg clone
cd hg-stable
make all&&make install
cp hgweb.cgi /var/www/
chmod u+x /var/www/hgweb.cgi
chown -R www-data:www-data /var/www
cd /var/www
vim /etc/apache2/sites-enabled/000-default
...
ScriptAlias /hg "/var/www/hgweb.cgi"
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
vim httpd.conf
ServerName localhost
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)
# cat hgweb.config
[collections]
/home/akin/hg-repo = /home/akin/hg-repo
就可以就可以找开了
cat /var/www/.hgrc
[web]
allow_push = *
push_ssl = false
chown -R www-data:www-data /home/akin/hg-repo
vim /etc/apache2/sites-enabled/000-default
...
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile /home/akin/hg-repo/password.properties
Require valid-user
htpasswd -c /home/akin/hg-repo/password.properties akin
/etc/init.d/apache2 restart
添加一个repo
cd /home/akin/hg-repo
mkdir hello
hg init hello/
cd hello/
touch hello
touch world
hg commit -m "init" -u akin
cd .hg
vim hgrc
[web]
name = hello
description = hello
contact = hello
push_ssl = false
allow_push = *
allow_archive = gz zip bz2
chown -R www-data:www-data /home/akin/hg-repo
检出:
hg clone
cd hello
touch akin
touch anks
hg add
hg commit -m "add akin anks files" -u akin
# hg push
????
??????
?? http ??
??: Mercurial repositories
??: akin
??:
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 2 changes to 2 files
摘定收工,总体上感觉比GIT简单呀,不知道这个分布试有啥好处!
阅读(1221) | 评论(0) | 转发(0) |