1

我已经按照 MT 的知识库文件在这里安装了 Mercurial 。

在我的 Mac 上使用 ssh 在服务器端工作可以正常工作。我可以初始化存储库等,但从服务器拉取或从我的 Mac 推送会产生我不明白的错误。

这是从本地安装调用 hg push 时得到的结果(哈希标记代表我的服务器编号):

remote: Traceback (most recent call last):
remote:   File "/home/#####/users/.home/data/mercurial-1.5/hg", line 27, in ?
remote:     mercurial.dispatch.run()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/dispatch.py", line 16, in run
remote:     sys.exit(dispatch(sys.argv[1:]))
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/dispatch.py", line 21, in dispatch
remote:     u = _ui.ui()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/ui.py", line 38, in __init__
remote:     for f in util.rcpath():
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/util.py", line 1200, in rcpath
remote:     _rcpath = os_rcpath()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/util.py", line 1174, in os_rcpath
remote:     path = system_rcpath()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/posix.py", line 41, in system_rcpath
remote:     path.extend(rcfiles(os.path.dirname(sys.argv[0]) +
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/posix.py", line 30, in rcfiles
remote:     rcs.extend([os.path.join(rcdir, f)
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/demandimport.py", line 75, in __getattribute__
remote:     self._load()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/demandimport.py", line 47, in _load
remote:     mod = _origimport(head, globals, locals)
remote: ImportError: No module named osutil
abort: no suitable response from remote hg!

我的 Mac 上的 Mercurial 配置如下

[ui]
username = John Smith
editor = te -w
remotecmd = ~/data/mercurial-1.5/hg

我的本地单个repo配置如下(哈希标记代表我的服务器号):

[paths]
default = ssh://mysite.com@s#####.gridserver.com/domains/mysite.com/html

服务器上的 Mercurial 只配置了一个用户名:

[ui]
username = John Smith

服务器 .bash_profile 配置如下(根据安装指南):

# Added this as suggested by the MediaTemple guide
export PYTHONPATH=${HOME}/lib/python:$PYTHONPATH
export PATH=${HOME}/bin:$PATH

我知道这可能不是 MediaTemple 问题,而更可能是安装问题。我真的很感激在这方面的任何帮助。提前致谢!

4

2 回答 2

1

您的 mercurial 安装不完整,您没有编译 osutil 模块(应该有一个 osutil.so 某处)。

于 2010-04-07T14:34:26.313 回答
0

@tonfa,

hgdebuginstall没有产生任何错误,这就是我遇到的问题如此奇怪的原因。

感谢您的回复,我进行了一些挖掘并在 中找到了模块~/lib/python/mercurial,所以我将osutil.so文件复制到我的~data/mercurial-1.5/mercurial目录中,就是这样......但是越来越多的模块找不到所以我决定复制整个内容一个目录到另一个目录,如下所示:

$ rm -R ~/data/mercurial-1.5/mercurial/*
$ cp -r ~/lib/python/mercurial/* ~/data/mercurial-1.5/mercurial

现在,一切正常。我不明白为什么 mercurial 似乎安装在两个目录中,或者为什么一个目录 ( ~/data/mercurial-1.5/mercurial) 没有获得与另一个目录 ( ) 相同的文件~/lib/python/mercurial

无论如何,这是我想出的解决方案。如果你(或任何人)能想到更优雅的东西,我会全神贯注,但事实上……这个对我有用。

谢谢你的时间。

于 2010-04-11T22:37:19.907 回答