【问题标题】:"abort: The system cannot find the file specified" in MercurialMercurial中的“中止:系统找不到指定的文件”
【发布时间】:2015-09-09 23:16:42
【问题描述】:

我有一个大型 (~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]

错误之前的最后一个文件实际上存在于 repo 中(它在 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

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

【问题讨论】:

  • 你能写出这个repo的URL吗?我想,你的问题不是长路径,而是 git-subrepo(在快速读取回溯输出后)的共同点 - 缺少本地 Git 可执行文件
  • 谢谢!你可能是对的:repo 确实有 git subrepos(这些是 GitHub 上的公共 repos)。不幸的是我不能分享回购。顺便说一句,hg-git 对我有用,否则我可以从 hg 拉出并推送到 git repos。

标签: python mercurial tortoisehg


【解决方案1】:

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

C:\Program Files (x86)\Git\bin\(或者你系统上有git.exe的地方)添加到PATHRapid Environment Editor(我需要使用这个工具,因为我的PATH超过1024个字符,所以使用setx不是'不工作)到系统变量解决了它。

【讨论】:

    猜你喜欢
    • 2011-01-28
    • 2019-08-03
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-21
    • 2023-03-17
    相关资源
    最近更新 更多