Mercurial:R 具有“hg status”,如何提交?

发布于 2024-09-27 07:03:38 字数 300 浏览 2 评论 0原文

如果我执行“hg status”并看到以下内容:

R flash/AC_OETags.js

这似乎意味着那里没有文件,但在某个时候有一个文件已被删除。

我如何“提交”此更改,以便在我执行“hg status”时它不再显示?

==更新==

答案似乎是提交文件。实际上,大约有 100 个状态为 R 的文件,因为我删除了整个目录树。有人知道如何一次性提交目录树中的所有文件吗?

我不想只进行 hg commit,因为还有其他更改。

If I do 'hg status' and see the following:

R flash/AC_OETags.js

it seems to mean that there is no file there, but there has been one at some point that has been removed.

How do I 'commit' this change so it stops showing up when I do 'hg status'?

==UPDATE==

The answer seems to be to commit the file. Actually, there are ~100 files with status R because I removed an entire directory tree. Anyone know how to commit all files in a directory tree in one go?

I don't want to do just hg commit, because there are other changes too.

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

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

发布评论

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

评论(3

完美的未来在梦里 2024-10-04 07:03:38

“R”的意思是“已删除”,因此下次我们在 Mercurial 中提交时,该文件将被删除。 (文件的历史记录将保留在存储库中,因此我们当然可以随时取回它)。

因此,运行你的 hg commit 命令,一切都会好起来,

感谢 hginit.com 的花絮 - 这是我的 Mercurial 圣经

The “R” means “Removed” so the next time we commit in Mercurial this file will be removed. (The history of the file will remain in the repository, so of course we can always get it back).

therefore run your hg commit command and all will be well

Thanks to hginit.com for that titbit - its my Mercurial bible

这个俗人 2024-10-04 07:03:38

您可以只提交该文件:

hg commit flash/AC_OETags.js

但是拥有“大量其他未提交的文件”是一个可怕的过程。您需要制定一个可以让您频繁提交的工作流程。

You can commit just that file:

hg commit flash/AC_OETags.js

however having "masses of other uncommitted files" is terrible process. You need to come up with a workflow that lets you commit frequently.

如梦亦如幻 2024-10-04 07:03:38

您可以使用 TortoiseHg 中的存储库资源管理器轻松管理要包含在提交中的文件。

此外,删除目录本身可能需要一个变更集。您应该养成更频繁地提交的习惯(一个概念,一次提交......而且无论如何它都是本地的)。此外,只要您没有将更改推送给任何人(或从您那里拉出的任何人),如果您认为分离得太多,您仍然可以使用 hg rebase --collapse 来重新组合一些更改集(这是一个更高级的功能,我建议您首先在测试存储库上尝试,因为如果您不小心,您可能会破坏东西)

You can use the repository explorer from TortoiseHg to easily manage the files you want to include in a commit.

Also, removing a directory probably warrants a changeset in itself. You should get into the habit of committing more often (one concept, one commit... and it's local anyway). Furthermore, as long as you haven't pushed your changes to anyone (or anyone pulled from you) you could still use hg rebase --collapse to regroup some changesets if you think you have separated too much (this is a more advanced feature that I suggest you try on a test repository first as you could break things if you're not careful)

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