TortoiseHg 未在更新时删除文件 +干净的

发布于 2024-10-07 01:54:41 字数 333 浏览 0 评论 0原文

我执行了以下步骤:

  1. 提交我的项目
  2. 在我的项目中添加了几个类文件
  3. 决定我想完全放弃我刚刚所做的事情
  4. 使用 TortoiseHg 存储库资源管理器通过“放弃本地更改,不备份(-C/-- clean)”检查/打开

我添加的两个类文件没有像我预期的那样被删除。它们出现在没有 shell 图标的文件夹中。

问题

  1. 这是正确的行为还是错误?
  2. 如果这是正确的,是否有一个功能可以让我返回到以前的变更集,而不会在我的工作副本中留下一堆垃圾文件?

I performed these steps:

  1. Commited my project
  2. Added a couple class files to my project
  3. Decided I wanted to completely abandon what I had just done
  4. Used TortoiseHg Repository Explorer to Update to last changeset with "Discard local changes, no backup (-C/--clean)" checked/turned on

The two class files I added did not get deleted as I would have expected. They appear in the folder without shell icons.

Questions

  1. Is this correct behavior or a bug?
  2. If this is correct, is there a feature that will allow me to go back to a previous changeset without ending up with a bunch of junk files in my working copy?

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

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

发布评论

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

评论(3

本王不退位尔等都是臣 2024-10-14 01:54:41

即使您 hg add 这些文件,如果您尚未提交它们,那么当您更新时,这些文件也会保留为未知文件。示例:

C:\> md test
C:\> cd test
C:\test> hg init
C:\test> echo >file1
C:\test> hg ci -Am file1
adding file1
C:\test> echo >file2
C:\test> echo >file3
C:\test> hg add
adding file2
adding file3
C:\test> hg st
A file2
A file3
C:\test> hg update -C
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\test> hg st
? file2
? file3

如果您启用 purge 扩展,则 hg purge 将删除状态为 ? 的文件。请小心,因为您打算添加到项目但尚未添加的文件将被删除:

C:\test> hg add file2
C:\test> hg status
A file2
? file3
C:\test> hg purge
C:\test> hg status
A file2

Even if you hg add the files, if you haven't committed them, when you update it leaves the files as unknown files. Example:

C:\> md test
C:\> cd test
C:\test> hg init
C:\test> echo >file1
C:\test> hg ci -Am file1
adding file1
C:\test> echo >file2
C:\test> echo >file3
C:\test> hg add
adding file2
adding file3
C:\test> hg st
A file2
A file3
C:\test> hg update -C
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\test> hg st
? file2
? file3

If you enable the purge extension, then hg purge will delete files with ? status. Be careful because files you meant to add to your project but haven't yet will be deleted:

C:\test> hg add file2
C:\test> hg status
A file2
? file3
C:\test> hg purge
C:\test> hg status
A file2
寄与心 2024-10-14 01:54:41

如果您没有将文件添加到存储库中,我认为它们根本不受版本控制。这也意味着版本控制系统不会处理它们,如果您希望删除它们,您必须自己删除它们。

仅当您实际上将它们置于版本控制之下(将它们添加到存储库)时,您才必须恢复更改,或显式从存储库中删除它们。

这样做的原因当然是您可能需要项目目录中的一些文件,而您根本不希望这些文件出现在版本控制存储库中。

If you don't have added the files to you repository, I think they are not at all under version control. That will also mean they are left alone by the version control system, and you'll have to delete them yourself if you want them to be deleted.

Only if you have actually put them under version control (added them to the repository), you will have to revert your changes, or explicitly delete them from you repository.

The reason for this is of course that you may need some files in your project directory that you don't want to be in your version control repository at all.

淡淡的优雅 2024-10-14 01:54:41

在您的工作文件夹上使用hg update null。查看文档

Use hg update null on your working folder. Check the docs.

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