Mercurial:“工作目录中未跟踪的文件与请求修订中的文件不同”?

发布于 2024-10-14 19:28:46 字数 712 浏览 4 评论 0原文

谁能告诉我这个 Mercurial 错误是什么意思?

工作目录中未跟踪的文件 与请求的文件不同 修订

在执行 hg fetch 时发生这种情况:

C:\myapp>hg fetch ssh://hg/myapp-v1
pulling from ssh://hg/myapp-v1
searching for changes
adding changesets
adding manifests
adding file changes
added 93 changesets with 693 changes to 78 files (+1 heads)
updating to 797:0df7dbe7dc06
196 files updated, 0 files merged, 196 files removed, 0 files unresolved
merging with 704:edb7765768c6
abort: untracked file in working directory differs from file in requested revision: 'a/b/c/d.java'

据我所知,此文件 (a/b/c/d.java) 与 .hgignore 中配置的任何路径都不匹配。而且这个特定文件在两个(myapp 和 myapp-v1)存储库中也是相同的。

我不清楚这意味着什么。 ??

Can anyone tell me what this Mercurial error means?

untracked file in working directory
differs from file in requested
revision

This occurred when doing an hg fetch:

C:\myapp>hg fetch ssh://hg/myapp-v1
pulling from ssh://hg/myapp-v1
searching for changes
adding changesets
adding manifests
adding file changes
added 93 changesets with 693 changes to 78 files (+1 heads)
updating to 797:0df7dbe7dc06
196 files updated, 0 files merged, 196 files removed, 0 files unresolved
merging with 704:edb7765768c6
abort: untracked file in working directory differs from file in requested revision: 'a/b/c/d.java'

From what I can tell this file (a/b/c/d.java) does not match any paths configured in .hgignore. And this specific file is also identical in the two (myapp & myapp-v1) repositories..

I am not clear what this even means. ??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

一曲琵琶半遮面シ 2024-10-21 19:28:46

它告诉您在 myapp 存储库的本地工作目录中已经有一个名为 a/b/c/d.java 的文件,但尚未添加(跟踪),并且 fetch 没有更新/合并时不愿意覆盖它。

您可以做的事情是以太坊:

  • 将您的 a/b/c/d.java 副本移开,然后进行拉取/更新。然后将您移动的 a/b/c/d.java 与一次获取的结果进行比较。

  • hg add a/b/c/d.javahg commit a/b/c/d.java,然后拉/合并

前者有效,因为没有较长的文件,后者可以工作,因为您的副本会被跟踪,因此 Mercurial 可以合并它们。

另外,您应该考虑停止使用 fetch。它为您组合了pullupdatemerge,但这并不是一种安全的方式。在这种情况下,您的pull将会成功,并且updatemerge都会给您提供更多有用的消息。

It's telling you you already have a file named a/b/c/d.java in your local working directory of the myapp repo, but it hasn't been added (tracked), and fetch isn't willing to overwrite it when updating/merging.

Things you can do are ether:

  • Move your copy of a/b/c/d.java out of the way and then do the pull/update. After that compare your moved a/b/c/d.java to the one fetch brings down.

or

  • hg add a/b/c/d.java, hg commit a/b/c/d.java, and then pull / merge

The former works because there's no longer a file in the way, and the later works because your copy is tracked so Mercurial can merge them.

Also, you should consider stopping using fetch. It combines pull and update and merge for you, which is just not a safe way to be. In this case your pull would have succeeded and both update and merge would have given you much more helpful messages.

原来是傀儡 2024-10-21 19:28:46

我通过运行 hg update --clean 解决了这个问题

I got around this by running hg update --clean

风吹雪碎 2024-10-21 19:28:46

只需接受错误对话框,然后勾选放弃本地更改,不备份

在此处输入图像描述

你应该很好,它会覆盖任何未跟踪的本地文件...

Just accept the error dialog then tick Discard local changes, no backup

enter image description here

And you should be good, it will overwrite any untracked local files...

云朵有点甜 2024-10-21 19:28:46

我尝试了 Ry4an 的答案(删除文件),但它仍然不起作用,所以我运行了一次清除,清除了所有痕迹,以便之后可以正常工作。以防万一有人正在寻找替代解决方案。

I tried Ry4an's answer (of deleting the file) and it still did not work, so I ran a purge and that got rid of all traces such that it worked after. Just in case somebody is looking for an alternative solution.

土豪我们做朋友吧 2024-10-21 19:28:46

如果使用 TortoiseHG,您可以在更新窗口中选中“放弃本地更改,不备份”选项。

If using TortoiseHG you can check the "Discard local changes, no backup" option in the Update window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文