新代码擅离职守,留下旧版本。它去哪儿了?
我刚刚在两周前打开了一个我最后一次参与的项目,发现我的工作版本落后了几个版本(通过 Bitbucket 使用 Mercurial)。我的开发计算机上最新编译的程序集是 100% 最新的,但我的本地和远程代码存储库缺少我在开发计算机上编译到最新程序集中的所有新代码。
使用 Red Gate 的 .NET Reflector,我可以看到我所有的最新代码,但现在在我的开发机器或我的任何存储库中都找不到这些代码。就好像我的所有代码都回到了未来。我是否有可能无意中恢复并覆盖了远程存储库中的一些代码并且没有任何踪迹?
我一定没有提交我的最新更改,但是这些肯定仍然应该在我的工作副本中吗?我不知道有任何系统回滚。我在 Windows 7 开发机上运行 Visual Studio 2010,我确信这不是 Mercurial 的错,但是否有一些我不知道的功能?这怎么可能?
I just opened up a project I last worked on two weeks ago and discovered that my working version is several revisions behind (using Mercurial via Bitbucket). The latest compiled assemblies on my dev machine are 100% up-to-date, but my local and remote code repositories are missing all the new code, which I compiled on my dev machine into the latest assemblies.
Disassembling the latest compile (a month old) using Red Gate's .NET Reflector, I can see all my newest code, but none of that is now anywhere to be found on my dev machine, or in any of my repositories. It's like all my code went back to the future. Is it possible I inadvertently reverted and overrode some code from my remote repository and there is no trail of it?
I must not have committed my latest changes, but surely these should still be in my working copy? I am unaware of any system roll-backs. I run Visual Studio 2010 on my Windows 7 dev box and I am sure this is not Mercurial's fault, but is there some functionality I am not aware of? How is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不提交总是是一个坏主意,提交就是你所说的“这是某事”而不是“这已经完成了”。
hg Summary
的输出是什么?您是否可能已hg update
d 到过去的修订版 - 如果是这样,所有新内容仍在存储库中,只是不在工作目录中。 Mercurial 永远不会丢弃已提交的更改,只有在更新时使用--clean
等选项时才会删除未提交的更改。如果您执行了hg revert
,您将拥有.orig
备份文件,除非您执行了--no-backup
。简而言之,除非您非常努力,否则 Mercurial 不会放弃更改,因此它们要么仍然存在,要么是外部的东西。
Not-committing is always a bad idea, committing is how you say "this is something" not "this is finished".
What is the output of
hg summary
? Is it possible you'vehg update
d to a past revision -- if so all the new stuff is still in the repo, just not the working directory. Mercurial never throws away committed changes, and only gets rid of uncommitted changes if you use an option like--clean
on update. If you didhg revert
you'll have.orig
backup files unless you did a--no-backup
.In brief, Mercurial won't throw away changes unless you work very hard at it, so either they're still there or it was something external.