查看文章
 
CentOS下mercurial安装[原]
2009-12-30 10:07

转载请注明,谢谢

1.       下载源码(yum不到)

wget http://mercurial.selenic.com/release/mercurial-1.4.1.tar.gz

2.       编译安装

a)         # make all

b)        # make install

c)        # hg debuginstall(3)

d)        # hg

      

3.       设置环境变量和安装检查

a)         编写一个脚本

# hg debuginstall 会出现abort: couldn't find mercurial libraries in。。。

可以在命令行中export,但范围和时间都很有限,不如找到hgmercurial的位置,进行如下修改:

# mv /usr/local/bin/hg /usr/local/bin/hg.py
# cat > /usr/local/bin/hg <<\EOF
#!/bin/sh
PYTHONPATH=/usr/local/lib64/python2.4/site-packages:${PYTHONPATH}
export PYTHONPATH
exec /usr/local/bin/hg.py "$@"
EOF

 

别忘了chmod 755 /usr/local/bin/hg

b)        添加配置文件

此时再运行hg debuginstall ,会出现

Checking username...

no username supplied (see "hg help config")

(specify a username in your .hgrc file)

1 problems detected, please check your install!

 

这是由于配置文件的原因

通过man hgrc会看到一些说明。默认是去一些位置找配置文件的。如果没有,就创建。源码中contrib文件夹下提供了一个sample.hgrc,可以拷贝过来修改

# cp sample.hgrc /root/.hgrc

# vim /root/.hgrc

 

这里改一下:

### show changed files and be a bit more verbose if True

 

# verbose = True

 

### username data to appear in comits

### it usually takes the form: Joe User <joe.user@host.com>

 

username = Joe Who <j.user@example.com>

verbose = True

 

### --- Extensions

 

再运行hg debuginstall ,出现这个提示就可以了

Checking encoding (UTF-8)...

Checking extensions...

Checking templates...

Checking patch...

patching file hg-debuginstall-wCOuEs

Checking commit editor...

Checking username...

No problems detected

 

运行hg,出现

分布式软件配置管理工具 - 水银 (版本 1.4.1)

 

版权所有 (C) 2005-2009 Matt Mackall <mpm@selenic.com> 和其他人。

这是自由软件,具体参见版权条款。这里没有任何担保,甚至没有适合

特定目的的隐含的担保。

 

 

REF: 

unixinstall

http://mercurial.selenic.com/wiki/UnixInstall

hgrc

http://www.selenic.com/mercurial/hgrc.5.html


类别:Software||添加到搜藏 |分享到i贴吧|浏览(2474)|评论 (0)
 
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu