【问题标题】:Mercurial commit fails: "The system cannot find the file specified", but it is not really specifiedMercurial 提交失败:“系统找不到指定的文件”,但并没有真正指定
【发布时间】:2017-07-19 16:14:47
【问题描述】:

我无法通过 Mercurial 提交单个文件。以下是命令的不同变体:

带有--traceback 的变体

C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --traceback "--message=Ad
ded a task Xml2Java for creation request/response files" --user "Petr Gangnus <petr.gangnus@moneta.cz>" -- application/build.gradle
transaction abort!
rollback completed
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\extensions.pyo", line 168, in closure
  File "hgext\color.pyo", line 521, in colorcmd
  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\commands.pyo", line 1546, in commit
  File "mercurial\cmdutil.pyo", line 2456, in commit
  File "mercurial\commands.pyo", line 1540, in commitfunc
  File "mercurial\localrepo.pyo", line 64, in wrapper
  File "mercurial\localrepo.pyo", line 1508, in commit
  File "mercurial\localrepo.pyo", line 64, in wrapper
  File "mercurial\localrepo.pyo", line 1596, in commitctx
  File "mercurial\extensions.pyo", line 168, in closure
  File "c:/Users/543829657/workspace/mercurial-tools/commitsigs.py", line 357, in add
  File "c:/Users/543829657/workspace/mercurial-tools/commitsigs.py", line 168, in opensslsign
  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
abort: The system cannot find the file specified

带有--debug的变体

C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --debug "--message=
Added a task Xml2Java for creation request/response files" --user "Petr Gangnus <petr.gangnus@moneta.cz>"
 -- application/build.gradle
calling hook precommit.checkfiles: hghook_precommit_checkfiles.fixup_hook
checkfiles: removing tabs and/or trailing whitespace in changed files...
checkfiles: opts:
checkfiles: checked extensions:
checkfiles: ignored extensions: .sln .suo .vcproj .csproj .ui
checkfiles: ignored files:
checkfiles: check diffs only: False
checkfiles: use spaces: True
checkfiles: tab size: 4
checkfiles: considering files:
  application/build.gradle
checkfiles: application/build.gradle ok
committing files:
application/build.gradle
committing manifest
committing changelog
transaction abort!
rollback completed
abort: The system cannot find the file specified

我和我的同事已经清理了提交的项目,重新克隆了它,是否拉取了更改,检查了所有 python 脚本和 ssh 密钥的可访问性......应该没问题,但事实并非如此。

我怀疑虽然“--debug”变体中的错误是在提交更改日志后出现的,但它可能与它有关吗?我在项目中没有看到任何名为“changelog”的文件,并且有三个包含该单词,它们显然都是旧的 - 从存储库克隆。

关于重复问题。似乎在许多完全不同的情况下会弹出该消息或类似消息:

Mercurial Editor: "abort: The system cannot find the file specified" - 在同一个脚本的这个地方提交失败,但是......堆栈本身是不同的,只有提交失败,没有消息。 我有消息。并且作者试图使用替代的默认编辑器并且不能 - 那是他的问题,与我的完全不同。 我没有更改编辑器。我对编辑没有问题。我已经安装了 hg,克隆了项目,更改了一个文件并想要提交它 - 仅此而已。

TortoiseHg can't commit--"The system cannot find the file specified" - 这里的错误信息头不是“abort:”,而是“abort:Adding:”

android studio gradle refresh failed (The system cannot find the file specified) - 这里从 Android Studio 调用提交并指定文件

"abort: The system cannot find the file specified" in Mercurial - 消息几乎相同,只是缺少的文件是 Mercurial 指定的。堆栈是不同的。就我而言,我可以更新,而那个作者不能。

在 SO 的其他情况下,带有该错误消息的不是 Mercurial 引发错误的原因。

我在不同的网站上看过很多类似的案例,但我没有发现同样的问题。重要的事情总是不同的。

@Leon 在下面假设了一个有趣的版本 - 原因是 openssl/gnupg 设置不正确。我检查了 openssl 的安装,运行 hg help commitsigs - 并阅读输出,注意到 forcesign 这样有趣的属性。

If the parametr is specified with a value of 1, the commit process will be
aborted and rolled back if the changeset cannot be signed for whatever reason
(bad setup, expired certificate and so on. The default is that the commit
will still be successful, but not signed.

是的,它看起来很有希望。 ...但是即使将该属性设置为 0 也不会改变这种情况。

【问题讨论】:

  • 不。从 TortoiseHg 或 IntelliJ 启动提交时,我看到了同样的问题,并且它们都可以管理路径分隔符...。我希望你已经找到它并尝试过 - 没有区别。还是谢谢你
  • 只是那个文件有问题,还是你根本无法提交?
  • 问题不可能出在要提交的文件上,请注意,在提交之前检查它 - 并发现OK。
  • 看起来问题是由Commitsigs Extension 引起的 - 要么配置错误,要么您没有用于签署提交的 X509 证书。
  • @Leon 当然,它与 commitsigs 连接,堆栈的老行显示在该文件中。好主意。并且有一些文件列表,并且在对文件的评论中提到了一些“文件”作为证书文件。但是这些密钥如何在克隆/更新中起作用而在提交时不起作用?这对我来说似乎很奇怪......

标签: mercurial mercurial-commit


【解决方案1】:

堆栈跟踪中的 commitsigs.py 条目表明问题是由 Commitsigs Extension 引起的。检查一下

  • 您的系统上安装了gnupgopenssl
  • 您拥有有效的 GPG 密钥(如果是 gnupg)或 X509 证书(如果是 openssl
  • 并且 Commitsigs 已正确配置(运行 hg help commitsigs 了解详细信息)。特别是gnupgopenssl 的路径必须正确指定,否则即使commitsigs.forcesign 模式被禁用,您也可能遇到上述问题。

【讨论】:

  • 谢谢你,我明天一定会检查你的方式。
  • 我已将检查您的版本的结果添加到问题的末尾。看来,是有些不一样了。 :-(
  • 那么您的 Commitsigs 设置/配置出了什么问题?
  • 您的想法肯定是正确的!因为我检查了 Mercurial.ini 中对“openssl.path”的引用——这很糟糕! (它在路径中包含程序文件,但不应该。请在您的答案中添加错误或缺少对 openssl 的引用。
猜你喜欢
  • 2012-08-31
  • 2011-01-28
  • 2015-09-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-22
  • 2020-08-23
  • 1970-01-01
相关资源
最近更新 更多