运行HG的TortoiseHg错误

时间:2015-09-11 15:25:56

标签: mercurial hook push tortoisehg

在将本地存储库推送到位于Windows 7中的网络共享位置的主存储库时,我遇到了错误。我已在主存储库中添加了一个挂钩来执行" hg update& #34;在推。当我从TortoiseHg中的本地存储库运行push时,我在控制台中收到此错误:

Traceback (most recent call last):
  File "c:\Python26\lib\site-packages\py2exe\boot_common.py", line 92, in <module>
ImportError: No module named linecache
Traceback (most recent call last):
  File "<install zipextimporter>", line 1, in <module>
ImportError: No module named zipextimporter
Traceback (most recent call last):
  File "hg", line 10, in <module>
ImportError: No module named os
warning: changegroup hook exited with status 255

推送发生,但没有成功执行挂钩。此外,似乎我一直在运行&#34; hg&#34;命令行中的命令,除非在C:\ Program Files \ TortoiseHg目录中运行它。我已经把&#34; C:\ Program Files \ TortoiseHg&#34;在PATH环境变量中,但没有任何成功。该系统是Windows 7 x64。

一般来说,TortoiseHg似乎可以工作,比如提交,更新,推送,拉动...但是像钩子这样的细节似乎不起作用。我只安装了Tortoise 3.5.1,没有任何Mercurial或Python。这是我从以下地方安装的地方:

http://bitbucket.org/tortoisehg/files/downloads/tortoisehg-3.5.1-x64.msi

http://tortoisehg.bitbucket.io/download/index.html

有人能帮助我吗?我在StackOverflow上看到过类似的问题,但是这个人安装了Mercurial和TortoiseHg。

那么,为什么在命令行中运行hg时会出现这些错误?为什么从TortoiseHg GUI推出并没有成功执行远程存储库上的钩子?

1 个答案:

答案 0 :(得分:0)

如果追溯来自push-target,那么

  • 拥有 Python 2.6('文件'c:\ Python26 \ lib \ site-packages \ py2exe \ boot_common.py“......')
  • Mercurial 3.5(因此 - TortoiseHG也)放弃了与Python 2.6,AFAICR的兼容性,但是:

THG使用Python的模块,如果$ PYTHON部分在PATH中较早且hg在THG home之外调用(在后一种情况下与THG模块捆绑使用);并且pwd用于运行钩子总是repo-dir

更改PATH(TBT!)中的顺序或将Python更新为2.7或从PATH中删除当前的Python

  

为什么从TortoiseHg GUI推送不能成功执行远程存储库上的挂钩?

由于:

  1. hook是推送目标任务,与推送源无关
  2. 您在服务器端遇到hg(挂钩)问题,这与客户端的THG无关