python - Mercurial 中的 "abort: The system cannot find the file specified"

标签 python mercurial tortoisehg hg-git

我有一个大型 (~700MB) Mercurial 存储库。我可以在不更新的情况下很好地克隆存储库(而且它在托管它的 Bitbucket 上完全可以浏览),但我无法将工作目录更新到最新的变更集,因为我收到以下错误:

... lot of getting [path] lines here
getting path/to/some/file.ext
abort: The system cannot find the file specified
[command returned code 255 Wed Jun 24 00:51:37 2015]

错误发生前的最后一个文件实际上存在于存储库中(在 Bitbucket 中也可见)。

我认为问题是因为路径太长,但即使克隆到驱动器根也会产生相同的结果。路径可能仍然太长,但“path/to/some/file.ext”只有 60 个字符。

使用回溯运行命令会产生以下结果:

Traceback (most recent call last):
  File "mercurial\dispatch.pyo", line 160, in _runcatch
  File "mercurial\dispatch.pyo", line 885, in _dispatch
  File "mercurial\dispatch.pyo", line 646, in runcommand
  File "mercurial\dispatch.pyo", line 976, in _runcommand
  File "mercurial\dispatch.pyo", line 947, in checkargs
  File "mercurial\dispatch.pyo", line 882, in <lambda>
  File "mercurial\util.pyo", line 716, in check
  File "mercurial\extensions.pyo", line 168, in closure
  File "mercurial\util.pyo", line 716, in check
  File "hgext\mq.pyo", line 3505, in mqcommand
  File "mercurial\util.pyo", line 716, in check
  File "mercurial\commands.pyo", line 6402, in update
  File "mercurial\hg.pyo", line 535, in clean
  File "mercurial\hg.pyo", line 520, in updaterepo
  File "mercurial\merge.pyo", line 1140, in update
  File "mercurial\merge.pyo", line 772, in applyupdates
  File "mercurial\subrepo.pyo", line 246, in submerge
  File "mercurial\context.pyo", line 252, in sub
  File "mercurial\subrepo.pyo", line 341, in subrepo
  File "mercurial\subrepo.pyo", line 1206, in __init__
  File "mercurial\subrepo.pyo", line 1216, in _ensuregit
  File "mercurial\subrepo.pyo", line 1294, in _gitnodir
  File "subprocess.pyo", line 710, in __init__
  File "subprocess.pyo", line 958, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

该存储库有 git 子存储库(这些是 GitHub 上的公共(public)存储库)。而且 hg-git 对我有用,否则我可以从 hg 中拉取和推送到 git 存储库。

有人知道如何解决这个问题吗?

最佳答案

解决了问题:Lazy Badger 指出了正确的方向。问题是 git 可执行文件的路径未添加到我的 PATH 环境变量中。

使用 Rapid Environment EditorC:\Program Files (x86)\Git\bin\ (或系统上有 git.exe 的位置)添加到 PATH 中(我需要使用这个工具,因为我的 PATH 超过 1024 个字符,因此使用 setx 不起作用)系统变量解决了这个问题。

关于python - Mercurial 中的 "abort: The system cannot find the file specified",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31014940/

相关文章:

python - 连接两个范围函数结果

mercurial - 强制 mq 仅在草稿上工作

mercurial - 如何解决Mercurial变更集注释中的错误?

python - 帮助我使用 mercurial 扩展 exportfiles

windows - 安装 Mercurial Activity 扩展的问题

python - 如何将参数重复传递给 python 文件

python - 对教程中的 enumerate() 函数感到困惑

python - 在 BST 中查找小于给定元素的元素数

java - 我可以在 Git/Mercurial 中安全地忽略 Eclipse 项目 .metadata 的哪些内容?

Mercurial 配置不正确