Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7428805
  • 博文数量: 1758
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16252
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1758)

文章存档

2024年(3)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2011-09-29 13:54:13

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
 
# cat hgweb.cgi
#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories
# 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简单呀,不知道这个分布试有啥好处!
阅读(1160) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~