CentOS下mercurial安装

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-1 23:23   11   0

转载请注明,谢谢

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 ,但范围和时间都很有限,不如找到hg 和mercurial 的位置,进行如下修改:

# 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

阅读全文>>

转载于:https://my.oschina.net/lgc/blog/5369

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP