Mercurial 删除了未跟踪的文件
在我们的存储库中,我们有数据库的初始版本(二进制文件)。
我已经执行了 hg pull,我看到有人提交了该文件的另一个版本。 由于我不会丢失开发数据库中的更改,因此我在同一目录中制作了它的副本(复制 file.db my_file.db)。
当我运行 hg up 时,mercurial 用新版本覆盖了 file.db 并删除了 my_file.db!
我使用的是 Windows 7 x64,并尝试了各种恢复已删除文件的软件,但没有成功。
如何取回我的 file.db 版本或恢复 my_file.db?我没有犯。
In our repository we have initial version of database (binary file).
I have executed hg pull and I saw that someone committed another version of this file.
As I won't to loose my changes in dev db, I did make a copy of it (copy file.db my_file.db) in same directory.
When I runned hg up, mercurial overwrited file.db with new version and deleted my_file.db!
I'm on windows 7 x64, and tried various software that recover deleted files, but with no success.
How can I get back my version of file.db or recover my_file.db? I didn't commit it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我真的不认为 Mercurial 删除了您未跟踪的文件。这是我所理解的您所描述的顺序:
您可以看到之后 my_file.db 仍然存在。即使使用
--clean
正如 Mikezx6r 提到的,该文件仍然存在:这不是您想听到的,但更有可能您不小心弄乱了“mv”,并且只认为您创建了副本或以某种方式外部删除了它。或者您的防病毒应用程序看到了它不喜欢的模式而拒绝创建它,或者其他一些可怕的意外事件。
现在它也没有帮助,但这是一个很好的例子,说明了为什么您应该尽早且经常提交,尤其是在更新之前 - 它太容易犯错误,但是一旦某些内容进入存储库,您就无法执行任何操作来意外删除它。
I really don't think mercurial deleted your untracked file. Here's the sequence you've described as I understand it:
You can see that afterward my_file.db is still there. Even with
--clean
as Mikezx6r mentiones the file is still there:It's not what you want to hear, but it's much more likely you accidentally botched the 'mv' and only thought you created the copy or somehow externally deleted it. Or your antivirus app saw a pattern it didn't like a refused to create it, or some other horrible, accidental thing.
It's also not helpful now, but this is a great example of why you should commit early and often, and especially before updating -- it's just too easy to make mistakes, but once something in in the repo there's nothing you can do to accidentally remove it.