Mercurial提交失败:“系统找不到指定的文件”,但没有真正指定

时间:2017-07-19 16:14:48

标签: mercurial mercurial-commit

我无法通过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调用提交,并指定文件IS

"abort: The system cannot find the file specified" in Mercurial - 消息几乎相同,只有Mercurial指定的丢失文件IS。堆栈是不同的。在我的情况下,我可以更新,而那位作者不能。

在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,情况也没有改变。

1 个答案:

答案 0 :(得分:2)

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

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