帮助让 Mercurial 在 Media Temple (gs) 上运行

发布于 2024-08-28 08:15:12 字数 2349 浏览 6 评论 0原文

我已经根据 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

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

[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 问题,但更可能是安装问题。我非常感谢对此的任何帮助。提前致谢!

I've installed Mercurial per MT's knowledge base file here.

Working with it server side using ssh from my Mac works fine. I can initialize repositories and the like, but pulling from the server or pushing from my Mac produces an error I don't understand.

Here's what I get when call hg push from my local installation (hash marks represent my server number):

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!

Mercurial on my Mac is configured as follows

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

My local single repo is configured as follows (hash marks represent my server number):

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

Mercurial on the server is configured with a just a username:

[ui]
username = John Smith

The server .bash_profile is configured as follows (per the installation guide):

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

I understand this probably isn't a MediaTemple problem, but more likely an installation problem. I would really appreciate any assitance on this. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑红尘 2024-09-04 08:15:12

您的 Mercurial 安装未完成,您没有编译 osutil 模块(某处应该有 osutil.so )。

Your mercurial installation isn't complete, you didn't compile the osutil module (there should be a osutil.so somewhere).

乖乖兔^ω^ 2024-09-04 08:15:12

@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)。

无论如何,这就是我想出的解决方案。如果你(或任何人)能想到更优雅的东西,我会洗耳恭听,但事实上......这个对我有用。

感谢您抽出时间。

@tonfa,

hgdebuginstall produced no errors, which is why the problem I was having was so weird.

Thanks to your response, I did some digging and found the module in ~/lib/python/mercurial, so I copied the osutil.so file over to my ~data/mercurial-1.5/mercurial directory and that was that... but then more and more modules couldn’t be found so I decided to copy the entire contents of one directory over to the other, like so:

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

Now, everything works fine. I don't understand why it seems that mercurial was installed in two directories, or why one directory (~/data/mercurial-1.5/mercurial) didn't get the same files as the other (~/lib/python/mercurial).

Anyway, this is the solution I came up with. If you (or anyone) can think of something more elegant, I'd be all ears, but as it is... this one works for me.

Thanks for your time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文