Visual Source Safe 真的缺乏重命名功能吗?
我在新工作中使用 Visual Source Safe,效果还不错……然后我重命名了一个文件。
我点击了警告提示,但没有真正注意到,通过重命名文件,我丢失了所有历史记录。 事实真的如此吗? 我不敢相信 VSS 不支持重命名。
我重构了很多代码,但没有正确地进行重命名确实很痛苦。
感谢您的回答。 我想 VSS 确实有重命名功能,只是 Visual Studio 中没有。 不过,切换应用程序来重命名源代码管理中的文件是多么大的破坏啊? :/
I'm using Visual Source Safe at a new job and it hasn't been too bad... then I renamed a file.
I clicked through the warning prompts not really paying attention realized that by renaming the file I lost all of my history. Is this really the case? I can't believe VSS doesn't support renaming.
I refactor lots of code and not having a renaming work properly really bites.
Thanks for the answers. I guess VSS does have renaming functionality, just not in Visual Studio. What a dealbreaker though, switching apps to rename a file in source control? :/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可以在 SourceSafe 中执行此操作,但需要一些手动干预:
重命名
菜单(或者只需按 F2),然后重命名该文件。如果您查看文件的历史记录(右键单击,然后
显示历史记录
,或者Ctrl-H
),您将看到其所有历史记录都完好无损。 但请注意,SourceSafe 将在该文件的所有历史条目中通过新名称引用该文件。 实际的重命名是在项目文件夹级别进行跟踪的。 如果您查看包含重命名文件的文件夹的历史记录,您将看到一个历史记录项,指示该文件已从oldname
重命名为newname
。附录:关于从历史记录中检索重命名文件的旧版本的说明
Joe White 评论了 这个答案表明,当您对旧版本的重命名文件执行
Get
时,SourceSafe 不会遵循原始文件名。 如果您从文件历史记录查看器获取旧版本,则确实如此。但是,如果您从父文件夹的历史查看器中
获取
旧版本的代码(重命名之前),SourceSafe 将在以下情况下正确使用原始文件名:它将文件放入您的工作文件夹中。出现此行为的原因可以追溯到 SourceSafe 在父文件夹级别而不是每个文件级别跟踪重命名的事实。
It's possible to do this in SourceSafe, but it requires a bit of manual intervention:
Rename
from the menu (or alternatively, simply press F2), then rename the file.If you view the file's history (right-click, then
Show History
, or altenatively,Ctrl-H
), you will see that all of its history is intact. Note, however, that SourceSafe will refer to the file by its new name in all of the history entries for the file. The actual rename is tracked at the project folder level. If you view the history of the folder that contains the renamed file, you'll see a history item indicating that the file was renamed fromoldname
tonewname
.Addendum: A note on retrieving older versions of renamed files from history
Joe White commented on this answer that SourceSafe doesn't honor the original filename when you do a
Get
on an older version of a renamed file. This is true, if you are getting the older version from the File History viewer.However, if you do a
Get
of an older version of your code (before the rename) from the parent folder's history viewer, SourceSafe will correctly use the original filename when it puts the files in your working folder.The reason for this behavior goes back to the fact that SourceSafe tracks renames at the parent folder level and not at the per-file level.
没关系。
一旦你看到你的 SourceSafe“数据库”由于你自己没有采取任何行动而被损坏,SS 就可以每天产生彩虹和独角兽,但它们最终会变成随机字节的溃烂海洋生物,人类无法恢复。
远离源安全。 微软为让人们了解源代码控制的想法做出了崇高的努力,但我已经两次(在 2 年内,同一个数据存储,3 个人反对它)看到它无可挽回的死亡。
进入 svn、tfs,或者其他任何东西! 告诉你的上级,你每次签到时都是在玩火。你可能会像我在失败之前的项目中一样幸运,或者你可能最终......依靠你的备份策略...... 。
It doesn't matter.
Once you've seen your SourceSafe "database" corrupted through no action of your own, SS could produce daily rainbows and unicorns, but they'd eventually morph into festering sea creatures of random bytes, unrecoverable by man.
Get away from Source Safe. It was a noble effort by Microsoft to get people into the idea of source control, but I've twice (in 2 years, same data store, 3 people working against it) seen it die an unrecoverable death.
Get into svn, tfs, anything else! Tell your higher-ups that you're playing with fire every time you check in. You may be as lucky as I was on the project before the failed one, or you could just end up... relying on your backup strategy...
VSS 具有保留历史记录的重命名功能
文件> 重命名
(我确信这会保留历史)但我已经很久没有使用它了
VSS has a rename feature which maitains history
File > Rename
(I am positive that this maitains history)but its been a long time since I've used it