TortoiseHg 未在更新时删除文件 +干净的
我执行了以下步骤:
- 提交我的项目
- 在我的项目中添加了几个类文件
- 决定我想完全放弃我刚刚所做的事情
- 使用 TortoiseHg 存储库资源管理器通过“放弃本地更改,不备份(-C/-- clean)”检查/打开
我添加的两个类文件没有像我预期的那样被删除。它们出现在没有 shell 图标的文件夹中。
问题
- 这是正确的行为还是错误?
- 如果这是正确的,是否有一个功能可以让我返回到以前的变更集,而不会在我的工作副本中留下一堆垃圾文件?
I performed these steps:
- Commited my project
- Added a couple class files to my project
- Decided I wanted to completely abandon what I had just done
- 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
- Is this correct behavior or a bug?
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
即使您
hg add
这些文件,如果您尚未提交它们,那么当您更新时,这些文件也会保留为未知文件。示例:如果您启用 purge 扩展,则
hg purge
将删除状态为?
的文件。请小心,因为您打算添加到项目但尚未添加的文件将被删除:Even if you
hg add
the files, if you haven't committed them, when you update it leaves the files as unknown files. Example: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:如果您没有将文件添加到存储库中,我认为它们根本不受版本控制。这也意味着版本控制系统不会处理它们,如果您希望删除它们,您必须自己删除它们。
仅当您实际上将它们置于版本控制之下(将它们添加到存储库)时,您才必须恢复更改,或显式从存储库中删除它们。
这样做的原因当然是您可能需要项目目录中的一些文件,而您根本不希望这些文件出现在版本控制存储库中。
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.
在您的工作文件夹上使用
hg update null
。查看文档。Use
hg update null
on your working folder. Check the docs.