我已经使用mercurial一年了,没有任何问题。在
今天我第一次遇到一个问题。在
当我试图用
$ hg push
我得到以下回应
^{pr2}$我在google上搜索了这个问题,发现它是一个有文档记录的问题,我发现了以下摘录自Mercurial FAQ:
4.28. I get a "no space left" or "disk quota exceeded" on pushI get a "no space left" or "disk quota exceeded" on push, but there is plenty of space or/and I have no quota limit on the device where the remote hg repository is.
The problem comes probably from the fact that mercurial uses /tmp (or one of the directory define by environment variables $TMPDIR, $TEMP or $TMP) to uncompress the bundle received on the wire. The decompression may then reach device limits.
You can of course set $TMPDIR to another location on remote in the default shell configuration file, but it will be potentially used by other processes than mercurial. Another solution is to set a hook in a global .hgrc on remote. See the description of how to set a hook for changing tmp directory on remote when pushing.
我在/etc/mercurial/hgrc
文件中创建了一个钩子,如下所示
[hooks]
pre-serve.tmpdir = python:hgenviron.settmpdir
然后我要创建hgenviron.py
import os
#see http://docs.python.org/lib/module-tempfile.html
def settmpdir(ui, repo, hooktype, node=None, source=None, **kwargs):
os.environ["TMPDIR"] = "/home/tmp"
我遇到的问题是我不知道如何将这个文件添加到fedora中的$PYTHONPATH
我的操作系统是Fedora 12 x86\u 64
我有python2.6
我有mercurial 1.6.4
更新:
我刚把hgenviron.py
添加到/usr/lib/python2.6/site-packages/hg/hgenviron.py
并且
PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/hg/hgenviron.py
export PYTHONPATH
到/etc/profile.d
中的.sh
文件,以及/etc/mercurial/
中的钩子。在
但是我仍然得到错误:
remote: abort: pre-serve.tmpdir hook is invalid (import of "hgenviron" failed) abort:
no suitable response from remote hg!
问题是使用了错误的import语句。它应该是
from hg import hgenviron
因为设置PYTHONPATH取决于添加它的方式/位置。在
在
/etc/profile.d
中,可以找到一组在加载bash时运行的脚本。/etc/profile
是全局文件,它调用脚本并具有以下注释:/etc/profile
在加载bash环境时运行。在本地,您可以编辑~/.bash_profile
或{您可以添加如下内容:
^{pr2}$如果您正努力弄清PYTHONPATH问题的底部,您可以明确说明hgenviron.py公司文件。在
pre-serve.tmpdir = python:/var/hg/hgenviron.py:settmpdir
请注意,settmpdir随后使用
:
而不是原始示例中的.
调用。在相关问题 更多 >
编程相关推荐