环境安装之安装mercurial
有部分是转载的 但是 照做不能安装成功 所以改了一部分内容
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)
# hg debuginstall 会出现abort: couldn't find mercurial libraries in。。。
原因:mercurial是由python写的 所以需要一个python的环境变量的配置 找到mercurial的包
运行
# find / -name mercurial 找到python下面 mercurial
我的在/root/lib64/python/mercurial
注意可能会搜索到 好几个 但是 要的是python下面的
然后添加环境变量 ---临时的 关掉客户端之后 不再生效
#export PYTHONPATH=/root/lib64/python---上面查找到的路径
另一种添加环境变量的方法 关闭客户端后生效
#python
vi /etc/profile 后面加入
PYTHONPATH=/root/lib64/python:$PYTHONPATH
export PYTHONPATH
此时再运行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